/* BeneVocon AI 1.26.2 — /ai/ workspace. Site tokens from studio-style (plum, gold, Inter); softer shapes and more depth than the brochure pages. */
.ai-page { --ai-side: 312px; --ai-col: 800px; --ai-line: rgba(255,236,214,.1); --ai-line-2: rgba(255,236,214,.17); --ai-panel: #1b0c19; --ai-raised: #271326; --ai-danger: #ff8b7b;
  --ai-r1: 10px; --ai-r2: 16px; overflow: hidden; }
.ai-page[data-view="loading"] { overflow: auto; }
.ai-page .site-header { background: rgba(13,5,13,.9); border-bottom-color: var(--ai-line); backdrop-filter: blur(10px); }
.ai-page [hidden] { display: none !important; }
.ai-page :focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 4px; }
/* The page's own scrolling areas show no scrollbar; they scroll by wheel, touch and keyboard as before. */
.ai-chat, .ai-thread, .ai-history, .ai-auth { scrollbar-width: none; -ms-overflow-style: none; }
.ai-chat::-webkit-scrollbar, .ai-thread::-webkit-scrollbar, .ai-history::-webkit-scrollbar, .ai-auth::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ai-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#announce { position: fixed; top: 0; left: 0; }   /* never adds height to the page (a taller page lets a phone scroll the chat under the header) */
.ai-skip { position: fixed; z-index: 1100; top: 10px; left: 10px; padding: 10px 14px; border-radius: var(--ai-r1); background: var(--gold); color: #160b10; font-weight: 700; text-decoration: none; transform: translateY(-160%); }
.ai-skip:focus { transform: none; }
/* The workspace runs edge to edge, so on this page the site logo sits in the left corner (above the chat list) instead of at the
   edge of the centred column. */
@media (min-width: 981px) { .ai-page .site-header .shell { width: calc(100% - 28px); } }
.ai-main { padding-top: var(--header-height); min-height: 100dvh;
  background: radial-gradient(1100px 540px at 64% -8%, rgba(124,46,112,.44), transparent 68%), radial-gradient(760px 440px at 0% 106%, rgba(242,178,63,.09), transparent 70%); }
.ai-noscript { margin: 120px auto; max-width: 40ch; text-align: center; color: var(--text-soft); }

/* Buttons and fields */
.ai-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--ai-r1);
  background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; font: inherit; font-size: .95rem; font-weight: 760; cursor: pointer; box-shadow: 0 10px 28px rgba(233,167,47,.2); transition: filter .15s ease, transform .15s ease; }
.ai-button:hover:not(:disabled) { filter: brightness(1.07); }
.ai-button:active:not(:disabled) { transform: translateY(1px); }
.ai-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.ai-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ai-button-quiet { background: transparent; border-color: var(--ai-line-2); color: var(--text); box-shadow: none; }
.ai-button-quiet:hover:not(:disabled) { border-color: var(--gold-line); filter: none; }
.ai-button-danger { background: #c2412f; color: #fff; box-shadow: none; }
.ai-link { padding: 4px 0; border: 0; background: none; color: var(--gold-2); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }
.ai-link:disabled { color: var(--text-muted); cursor: default; text-decoration: none; }
.ai-icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--ai-r1); background: none; color: var(--text-soft); cursor: pointer; }
.ai-icon-button:hover { border-color: var(--ai-line-2); background: rgba(255,236,214,.04); color: var(--text); }
.ai-icon-button svg, .ai-account-button svg, .ai-attach svg, .ai-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Loading */
.ai-loading { display: grid; place-content: center; justify-items: center; gap: 18px; min-height: calc(100dvh - var(--header-height)); color: var(--text-soft); }
.ai-spinner { width: 34px; height: 34px; border: 3px solid var(--ai-line-2); border-top-color: var(--gold); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* The growth curve above "What's your game?" (its motion is further down, at .ai-climb). */
.ai-curve { display: block; overflow: visible; }
@keyframes ai-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Sign in / create account: a panel in front of the page. The visitor sees the workspace first; this opens when they send a
   message without being signed in, or ask for it. A fixed layer, not a <dialog> (see the note in index.html). */
.ai-auth { position: fixed; z-index: 1200; inset: 0; display: flex; padding: 20px; overflow: auto; overscroll-behavior: contain; background: rgba(9,4,9,.76); backdrop-filter: blur(7px); animation: ai-auth-in .18s ease both; }
.ai-auth-inner { width: min(460px, 100%); margin: auto; animation: ai-rise .26s var(--ease) both; }   /* margin auto: centred when it fits, scrollable from the top when it does not */
@keyframes ai-auth-in { from { opacity: 0; } }
.ai-auth .ai-card { position: relative; background: linear-gradient(180deg, #2d152a, #1b0c19); backdrop-filter: none; }
.ai-auth-close { position: absolute; z-index: 1; top: 10px; right: 10px; }
.ai-auth-close:hover { color: var(--text); }
.ai-auth-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ai-auth-intro { padding: 26px 60px 0 26px; }
.ai-auth-intro h2 { margin: 0; font-size: 1.34rem; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.ai-auth-intro p { margin: 8px 0 0; color: var(--text-soft); font-size: .94rem; line-height: 1.5; }
.ai-auth-intro + .ai-tabs { margin-top: 18px; }
.ai-auth-intro[hidden] ~ .ai-form h2 { padding-right: 40px; }   /* room for the close button when a form brings its own heading */

.ai-card { border: 1px solid var(--gold-line); border-radius: var(--ai-r2); background: linear-gradient(180deg, rgba(47,22,44,.82), rgba(27,12,25,.94)); box-shadow: 0 30px 80px rgba(0,0,0,.42), 0 0 90px rgba(242,178,63,.07); overflow: hidden; backdrop-filter: blur(8px); }
.ai-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 14px 0; padding: 5px; border: 1px solid var(--ai-line); border-radius: 12px; background: rgba(9,4,9,.45); }
.ai-tabs button { padding: 11px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-soft); font: inherit; font-weight: 680; cursor: pointer; }
.ai-tabs button[aria-selected="true"] { background: rgba(242,178,63,.15); color: var(--text); box-shadow: inset 0 0 0 1px rgba(242,178,63,.34); }
.ai-form { display: grid; gap: 8px; padding: 20px 26px 28px; }
.ai-form h2 { margin: 6px 0 2px; font-size: 1.3rem; letter-spacing: -.02em; }
.ai-form label { margin-top: 8px; font-size: .9rem; font-weight: 640; }
.ai-form label small { margin-left: 6px; color: var(--text-muted); font-weight: 400; font-size: .82rem; }
.ai-form input[type="email"], .ai-form input[type="password"], .ai-form input[type="text"], .ai-dialog input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r1); background: rgba(9,4,9,.55); color: var(--text); font: inherit; font-size: 1rem; }
.ai-form input:focus, .ai-dialog input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(242,178,63,.18); }
.ai-form input[inputmode="numeric"] { letter-spacing: .42em; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ai-form .ai-button { margin-top: 14px; width: 100%; }
.ai-check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin-top: 10px; font-weight: 400 !important; color: var(--text-soft); line-height: 1.45; cursor: pointer; }
.ai-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); }
.ai-check a, .ai-form-note a { color: var(--gold-2); }
.ai-captcha { min-height: 78px; margin-top: 12px; }
.ai-captcha:empty { min-height: 0; margin: 0; }
.ai-form-error { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid var(--ai-danger); border-radius: 0 8px 8px 0; background: rgba(255,139,123,.08); color: #ffd3cc; font-size: .92rem; line-height: 1.45; }
.ai-form-ok { margin: 0; padding: 12px 26px 18px; color: #bfe9c9; font-size: .92rem; }
/* An account is not created: what stands in the way, in a box of its own at the top of the sign-up form. When nothing can be
   done about it in this browser (data-blocked), the fields make room for it and for the way to the sign-in form. */
.ai-warning { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 12px; align-items: start; margin: 4px 0 2px; padding: 14px 16px; border: 1px solid rgba(242,178,63,.5); border-radius: var(--ai-r1); background: rgba(242,178,63,.1); }
.ai-warning svg { grid-row: 1 / span 2; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--gold-2); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ai-warning strong { grid-column: 2; color: var(--text); font-size: .98rem; font-weight: 720; line-height: 1.35; }
.ai-warning p { grid-column: 2; margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.ai-form[data-blocked="true"] > :not(.ai-warning):not(#register-to-login) { display: none; }
/* Signing in with an account at Google, Apple or Microsoft: plain buttons under the form. A logo shows only when the site
   owner has put that provider's own logo file beside the page (bv-ai-v1/idp/); nothing is loaded from the providers. */
.ai-sso { padding: 0 26px 26px; }
.ai-sso-or { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: var(--text-muted); font-size: .82rem; }
.ai-sso-or::before, .ai-sso-or::after { content: ""; flex: 1; height: 1px; background: var(--ai-line-2); }
.ai-sso-list { display: grid; gap: 8px; }
.ai-sso-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 16px; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r1); background: rgba(255,236,214,.04); color: var(--text); font-size: .94rem; font-weight: 640; text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.ai-sso-button:hover { border-color: var(--gold-line); background: rgba(255,236,214,.08); }
.ai-sso-button img { width: 20px; height: 20px; object-fit: contain; }
.ai-acct-sso { margin-top: 6px !important; color: var(--text-muted); font-size: .86rem; line-height: 1.45; }
@media (max-width: 560px) { .ai-sso { padding: 0 18px 22px; } }
.ai-form-text { margin: 0 0 4px; color: var(--text-soft); line-height: 1.55; font-size: .95rem; }
.ai-form-text strong { color: var(--text); overflow-wrap: anywhere; }
.ai-form-note { margin: 12px 0 0; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.ai-form-row { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; }

/* Signed in: chat list on the left, conversation on the right */
.ai-shell { display: grid; grid-template-columns: var(--ai-side) minmax(0, 1fr); height: calc(100dvh - var(--header-height)); }
.ai-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 16px 14px 14px; border-right: 1px solid var(--ai-line); background: rgba(11,4,11,.66); backdrop-filter: blur(12px); }
.ai-side-brand { display: flex; align-items: center; gap: 9px; margin: 2px 4px 14px; font-size: 1rem; font-weight: 780; letter-spacing: -.015em; }
.ai-side-brand svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: linear-gradient(135deg, #ffd16c, #e9a72f); fill: none; stroke: #160b10; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ai-new { width: 100%; min-height: 46px; }
.ai-history { flex: 1; min-height: 0; margin: 10px -6px 0; padding: 0 6px; overflow-y: auto; }
.ai-history ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ai-history li { min-width: 0; }
.ai-history-group { padding: 14px 12px 5px; color: var(--text-muted); font-size: .76rem; font-weight: 640; }
.ai-history button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: none; color: var(--text-soft); font: inherit; font-size: .92rem; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ai-history button:hover { background: rgba(255,236,214,.05); color: var(--text); }
.ai-history button[aria-current="true"] { background: rgba(242,178,63,.13); color: var(--text); box-shadow: inset 0 0 0 1px rgba(242,178,63,.3); }
.ai-history-empty { margin: 18px 12px; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.ai-account { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 14px; border-top: 1px solid var(--ai-line); }   /* minmax(0,…): a long e-mail address must not widen the column */
/* Usage limits: shown in a panel opened from the account menu */
.ai-meter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; margin-top: 6px; color: var(--text-soft); font-size: .95rem; }
.ai-meter-rows { list-style: none; display: grid; gap: 14px; margin: 0; padding: 0; }
.ai-meter-rows li { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; align-items: baseline; }
.ai-meter-rows small { grid-column: 1 / -1; color: var(--text-muted); font-size: .82rem; }
.ai-dialog .ai-meter-status { margin: 0; padding: 10px 12px; border-radius: var(--ai-r1); background: rgba(255,236,214,.05); color: var(--text-soft); font-size: .9rem; }
.ai-meter[data-low="true"] .ai-meter-status { background: rgba(255,139,123,.1); color: #ffd3cc; }
.ai-meter-rows b { color: var(--text-soft); font-weight: 640; font-variant-numeric: tabular-nums; }
.ai-meter-track { grid-column: 1 / -1; height: 7px; border-radius: 3px; background: rgba(255,236,214,.1); overflow: hidden; }
.ai-meter-track i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #e9a72f, #ffd97f); transition: width .3s ease; }
.ai-meter-rows li[data-full="true"] b { color: #ffd3cc; }
.ai-meter-rows li[data-full="true"] i { background: var(--ai-danger); }
.ai-guest { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--ai-line-2); border-radius: 12px; background: rgba(255,236,214,.025); }
.ai-guest p { margin: 0 0 4px; color: var(--text-soft); font-size: .86rem; line-height: 1.45; }
.ai-guest .ai-button { width: 100%; min-height: 42px; }
.ai-guest .ai-menu-links { margin-top: 2px; padding: 10px 0 0; }
.ai-account-button { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; max-width: 100%; padding: 8px 11px 8px 8px; border: 1px solid var(--ai-line-2); border-radius: 12px; background: rgba(255,236,214,.025); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; }
.ai-account-button:hover { border-color: var(--gold-line); }
.ai-account-initial { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(242,178,63,.18); color: var(--gold-2); font-style: normal; font-weight: 760; font-size: .86rem; text-transform: uppercase; }
.ai-account-button span { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: .84rem; }
.ai-account-button svg { flex: none; width: 16px; height: 16px; transition: transform .15s ease; }
.ai-account-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.ai-menu { position: absolute; left: 0; right: 0; bottom: 52px; z-index: 5; display: grid; padding: 6px; border: 1px solid var(--gold-line); border-radius: 14px; background: #1f0f1d; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.ai-menu > a, .ai-menu > button { padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left; text-decoration: none; cursor: pointer; }
.ai-menu > a:hover, .ai-menu > button:hover { background: rgba(255,236,214,.07); }
.ai-menu-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px 6px; margin-top: 4px; border-top: 1px solid var(--ai-line); font-size: .8rem; }
.ai-menu-links a { color: var(--text-muted); }

.ai-chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.ai-chat::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: radial-gradient(rgba(255,236,214,.085) 1px, transparent 1.5px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 34%, #000, transparent 76%); mask-image: radial-gradient(ellipse 72% 62% at 50% 34%, #000, transparent 76%); }
.ai-chat > * { position: relative; z-index: 1; }
.ai-chat-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--ai-line); background: rgba(16,7,16,.42); backdrop-filter: blur(10px); }
.ai-head-login { flex: none; min-height: 38px; padding: 0 14px; font-size: .88rem; }
.ai-chat-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 1rem; font-weight: 660; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-actions { display: flex; gap: 2px; }
#side-toggle { display: none; }
.ai-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; scroll-behavior: smooth; padding: 0 clamp(14px, 3vw, 28px); }

/* New chat: the question and the box to answer it sit together in the middle; the examples follow. */
.ai-chat[data-empty="true"] { overflow-y: auto; }
.ai-chat[data-empty="true"] .ai-chat-head { border-bottom-color: transparent; background: none; backdrop-filter: none; }
@media (min-width: 981px) { .ai-chat[data-empty="true"] .ai-chat-head { display: none; } }
.ai-chat[data-empty="true"] .ai-thread { flex: 0 0 auto; overflow: visible; margin-top: auto; }
.ai-chat[data-empty="true"] .ai-composer { margin-bottom: auto; padding-bottom: 40px; }
.ai-chat[data-empty="true"] .ai-composer textarea { min-height: 92px; padding-top: 20px; font-size: 1.08rem; }
.ai-chat[data-empty="true"] .ai-composer-box { box-shadow: 0 0 0 1px rgba(242,178,63,.2), 0 26px 70px rgba(0,0,0,.46), 0 0 110px rgba(242,178,63,.13); }
.ai-empty { max-width: var(--ai-col); margin: 0 auto; padding: clamp(16px, 4vh, 40px) 0 28px; text-align: center; }
/* The curve has its own band above the question, as wide as the message box below it. */
.ai-empty-chart { position: relative; height: clamp(64px, 13vh, 118px); margin: 0 6px clamp(14px, 3vh, 26px); }
.ai-empty-chart .ai-curve { width: 100%; height: 100%; }
/* The curve is drawn once. When its tip reaches the top it keeps climbing: the view follows the tip, so the tip stays where it
   is and what it has passed falls behind. Five "levels" leave the tip one after another; each is a hairline that sinks with a
   bead where it crosses the curve, sliding back down the line. The curve is an exponential, so a chart that follows it keeps
   this exact shape while the levels sink ever more slowly towards the bottom: that is what the keyframes below reproduce
   (they are made from the 41 points of the path; if the path changes they must be made again). Nothing ever starts over. */
.ai-climb-track { opacity: .3; }
.ai-climb { animation: ai-climb-draw 2.4s linear both; }
@keyframes ai-climb-draw { from { clip-path: inset(-14px 100% -14px -14px); } to { clip-path: inset(-14px 0% -14px -14px); } }
.ai-climb-tip { position: absolute; inset: 0; pointer-events: none; transform: translate(100%, 9%); animation: ai-climb-tip 2.4s linear both; }
.ai-climb-tip::before { content: ""; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 5px rgba(242,178,63,.18), 0 0 26px rgba(255,211,111,.9); }
.ai-climb-tip::after { content: ""; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,211,111,.8); opacity: 0; animation: ai-climb-ping 1.6s 2.4s ease-out infinite; }
@keyframes ai-climb-ping { 0% { opacity: .9; transform: none; } 70%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes ai-climb-tip { 0% { transform: translate(0%, 92%); opacity: 0; } 2.5% { transform: translate(2.5%, 91.75%); } 5% { transform: translate(5%, 91.45%); opacity: 1; } 7.5% { transform: translate(7.5%, 91.15%); } 10% { transform: translate(10%, 90.85%); } 12.5% { transform: translate(12.5%, 90.5%); } 15% { transform: translate(15%, 90.1%); } 17.5% { transform: translate(17.5%, 89.65%); } 20% { transform: translate(20%, 89.2%); } 22.5% { transform: translate(22.5%, 88.7%); } 25% { transform: translate(25%, 88.15%); } 27.5% { transform: translate(27.5%, 87.55%); } 30% { transform: translate(30%, 86.9%); } 32.5% { transform: translate(32.5%, 86.2%); } 35% { transform: translate(35%, 85.45%); } 37.5% { transform: translate(37.5%, 84.6%); } 40% { transform: translate(40%, 83.7%); } 42.5% { transform: translate(42.5%, 82.7%); } 45% { transform: translate(45%, 81.65%); } 47.5% { transform: translate(47.5%, 80.45%); } 50% { transform: translate(50%, 79.2%); } 52.5% { transform: translate(52.5%, 77.8%); } 55% { transform: translate(55%, 76.25%); } 57.5% { transform: translate(57.5%, 74.6%); } 60% { transform: translate(60%, 72.85%); } 62.5% { transform: translate(62.5%, 70.85%); } 65% { transform: translate(65%, 68.75%); } 67.5% { transform: translate(67.5%, 66.45%); } 70% { transform: translate(70%, 63.9%); } 72.5% { transform: translate(72.5%, 61.15%); } 75% { transform: translate(75%, 58.15%); } 77.5% { transform: translate(77.5%, 54.9%); } 80% { transform: translate(80%, 51.35%); } 82.5% { transform: translate(82.5%, 47.5%); } 85% { transform: translate(85%, 43.3%); } 87.5% { transform: translate(87.5%, 38.75%); } 90% { transform: translate(90%, 33.75%); } 92.5% { transform: translate(92.5%, 28.35%); } 95% { transform: translate(95%, 22.4%); } 97.5% { transform: translate(97.5%, 16%); } 100% { transform: translate(100%, 9%); } }
.ai-rise, .ai-rise b { position: absolute; inset: 0; pointer-events: none; }
.ai-rise { opacity: 0; animation: ai-rise-y 8s linear infinite; }
.ai-rise b { transform: translateX(100%); animation: ai-rise-x 8s linear infinite; }
.ai-rise::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(255,211,111,0), rgba(255,211,111,.2) 22%, rgba(255,211,111,.2) 78%, rgba(255,211,111,0)); }
.ai-rise b::before { content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 10px rgba(255,211,111,.75); }
.ai-rise:nth-of-type(1), .ai-rise:nth-of-type(1) b { animation-delay: 2.4s; }
.ai-rise:nth-of-type(2), .ai-rise:nth-of-type(2) b { animation-delay: 4s; }
.ai-rise:nth-of-type(3), .ai-rise:nth-of-type(3) b { animation-delay: 5.6s; }
.ai-rise:nth-of-type(4), .ai-rise:nth-of-type(4) b { animation-delay: 7.2s; }
.ai-rise:nth-of-type(5), .ai-rise:nth-of-type(5) b { animation-delay: 8.8s; }
@keyframes ai-rise-x { from { transform: translateX(100%); } to { transform: translateX(0%); } }
@keyframes ai-rise-y { 0% { transform: translateY(9%); opacity: 0; } 2.5% { transform: translateY(16%); } 5% { transform: translateY(22.4%); opacity: 1; } 7.5% { transform: translateY(28.35%); } 10% { transform: translateY(33.75%); } 12.5% { transform: translateY(38.75%); } 15% { transform: translateY(43.3%); } 17.5% { transform: translateY(47.5%); } 20% { transform: translateY(51.35%); } 22.5% { transform: translateY(54.9%); } 25% { transform: translateY(58.15%); } 27.5% { transform: translateY(61.15%); } 30% { transform: translateY(63.9%); } 32.5% { transform: translateY(66.45%); } 35% { transform: translateY(68.75%); } 37.5% { transform: translateY(70.85%); } 40% { transform: translateY(72.85%); } 42.5% { transform: translateY(74.6%); } 45% { transform: translateY(76.25%); } 47.5% { transform: translateY(77.8%); } 50% { transform: translateY(79.2%); } 52.5% { transform: translateY(80.45%); } 55% { transform: translateY(81.65%); opacity: 1; } 57.5% { transform: translateY(82.7%); } 60% { transform: translateY(83.7%); } 62.5% { transform: translateY(84.6%); } 65% { transform: translateY(85.45%); } 67.5% { transform: translateY(86.2%); } 70% { transform: translateY(86.9%); } 72.5% { transform: translateY(87.55%); } 75% { transform: translateY(88.15%); } 77.5% { transform: translateY(88.7%); } 80% { transform: translateY(89.2%); } 82.5% { transform: translateY(89.65%); } 85% { transform: translateY(90.1%); } 87.5% { transform: translateY(90.5%); } 90% { transform: translateY(90.85%); } 92.5% { transform: translateY(91.15%); } 95% { transform: translateY(91.45%); } 97.5% { transform: translateY(91.75%); } 100% { transform: translateY(92%); opacity: 0; } }
.ai-empty h2 { margin: 0; font-size: clamp(2rem, 1.2rem + 2.7vw, 3.3rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 800; text-wrap: balance; }
.ai-empty > p { max-width: 56ch; margin: 14px auto 0; color: var(--text-soft); line-height: 1.6; text-wrap: pretty; }
.ai-notice { margin-top: 22px !important; padding: 12px 14px; border: 1px solid var(--gold-line); border-radius: var(--ai-r1); background: rgba(242,178,63,.08); color: var(--text) !important; }
.ai-starters { display: none; }
.ai-chat[data-empty="true"] .ai-starters { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: var(--ai-col); margin: 18px auto 0; padding: 0; }
.ai-starters button { display: grid; gap: 6px; align-content: start; width: 100%; height: 100%; padding: 14px 16px 15px; border: 1px solid var(--ai-line); border-radius: 14px; background: rgba(27,12,25,.6); color: var(--text-soft); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.ai-chat[data-empty="true"] .ai-composer[data-mode="image"] #starters, .ai-chat[data-empty="true"] .ai-composer:not([data-mode="image"]) #starters-image { display: none; }
.ai-starters b { color: var(--gold-2); font-size: .84rem; font-weight: 720; }
.ai-starters span { font-size: .92rem; line-height: 1.45; }
.ai-starters button:hover { border-color: var(--gold-line); background: rgba(242,178,63,.07); color: var(--text); }

.ai-messages { list-style: none; max-width: var(--ai-col); margin: 0 auto; padding: 26px 0 18px; display: grid; gap: 22px; }
.ai-messages:empty { display: none; }
.ai-msg { min-width: 0; }
.ai-msg[data-fresh="true"] { animation: ai-rise .28s ease both; }
.ai-msg-user { justify-self: end; max-width: min(86%, 640px); }
.ai-msg-user .ai-bubble { padding: 13px 17px; border: 1px solid rgba(242,178,63,.36); border-radius: 18px 18px 5px 18px; background: linear-gradient(135deg, rgba(255,209,108,.19), rgba(233,167,47,.08)); color: var(--text); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg-images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.ai-msg-images button { padding: 0; border: 1px solid var(--ai-line-2); border-radius: 12px; background: #0c050c; overflow: hidden; cursor: zoom-in; line-height: 0; }
.ai-msg-images img { display: block; width: auto; height: 132px; max-width: 220px; object-fit: cover; }
.ai-reply { border: 1px solid var(--ai-line); border-radius: var(--ai-r2); background: linear-gradient(180deg, rgba(43,21,41,.78), rgba(27,12,25,.84)); box-shadow: 0 16px 44px rgba(0,0,0,.26); }
.ai-reply-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--ai-line); font-size: .9rem; font-weight: 720; }
.ai-avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #ffd16c, #e9a72f); }
.ai-avatar svg { width: 17px; height: 17px; fill: none; stroke: #160b10; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ai-copy { margin-left: auto; padding: 6px 11px; border: 1px solid var(--ai-line-2); border-radius: 8px; background: none; color: var(--text-soft); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.ai-copy:hover { border-color: var(--gold-line); color: var(--text); }
.ai-answer { min-width: 0; padding: 18px 20px 20px; color: #f4ecf1; line-height: 1.68; overflow-wrap: anywhere; }
.ai-answer > :first-child { margin-top: 0; }
.ai-answer > :last-child { margin-bottom: 0; }
.ai-answer p { margin: 0 0 14px; }
.ai-answer h3 { margin: 26px 0 10px; padding-left: 12px; border-left: 3px solid var(--gold); font-size: 1.14rem; line-height: 1.3; letter-spacing: -.015em; color: var(--text); }
.ai-answer h4 { margin: 20px 0 8px; font-size: 1.02rem; color: var(--gold-2); font-weight: 700; }
.ai-answer h5 { margin: 16px 0 6px; font-size: .95rem; color: var(--text); }
.ai-answer ul, .ai-answer ol { margin: 0 0 14px; padding-left: 24px; }
.ai-answer li { margin: 5px 0; padding-left: 2px; }
.ai-answer li::marker { color: var(--gold-2); font-weight: 720; }
.ai-answer li > ul, .ai-answer li > ol { margin: 4px 0 4px; }
.ai-answer strong { color: #fff; font-weight: 700; }
.ai-answer a { color: var(--gold-2); }
.ai-answer code { padding: 1px 6px; border-radius: 5px; background: rgba(255,236,214,.1); font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
.ai-code { margin: 0 0 16px; border: 1px solid var(--ai-line-2); border-radius: 12px; background: #0c050c; overflow: hidden; }
.ai-code-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 14px; border-bottom: 1px solid var(--ai-line); color: var(--text-muted); font-size: .76rem; }
.ai-code-head button { padding: 5px 10px; border: 0; border-radius: 7px; background: none; color: var(--text-soft); font: inherit; cursor: pointer; }
.ai-code-head button:hover { background: rgba(255,236,214,.08); color: var(--text); }
.ai-code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; scrollbar-width: thin; }
.ai-code code { padding: 0; background: none; font-size: .86rem; line-height: 1.6; white-space: pre; color: #efe3ea; }
.ai-answer blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: rgba(242,178,63,.06); color: var(--text-soft); }
.ai-answer blockquote > :last-child { margin-bottom: 0; }
.ai-answer hr { margin: 22px 0; border: 0; border-top: 1px solid var(--ai-line); }
/* Web search: the small numbers after a sentence, the list of pages under the answer, and the notice while a search runs */
.ai-answer a.ai-cite { display: inline-block; min-width: 1.5em; margin: 0 1px; padding: 0 5px; border: 1px solid var(--ai-line-2); border-radius: 999px; color: var(--gold-2); font-size: .72em; font-weight: 680; line-height: 1.55; text-align: center; text-decoration: none; vertical-align: .22em; }
.ai-answer a.ai-cite:hover { border-color: var(--gold-line); background: rgba(242,178,63,.12); }
.ai-sources { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ai-line); }
.ai-sources > p { margin: 0 0 8px !important; color: var(--text-muted); font-size: .8rem; font-weight: 660; }
.ai-sources ol { display: grid; gap: 6px; margin: 0; padding-left: 1.6em; font-size: .9rem; }
.ai-sources li { padding-left: 2px; overflow-wrap: anywhere; }
.ai-sources li::marker { color: var(--text-muted); font-size: .85em; }
.ai-sources small { margin-left: 8px; color: var(--text-muted); font-size: .82em; }
.ai-searching { display: flex; align-items: center; gap: 6px; margin: 12px 0 0 !important; color: var(--text-muted); font-size: .9rem; }
.ai-searching i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .35; animation: ai-dot 1.1s ease-in-out infinite; }
.ai-searching i:nth-child(2) { animation-delay: .16s; }
.ai-searching i:nth-child(3) { animation-delay: .32s; margin-right: 4px; }
.ai-table { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--ai-line-2); border-radius: 12px; }
.ai-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ai-table th, .ai-table td { padding: 10px 13px; border-bottom: 1px solid var(--ai-line); text-align: left; vertical-align: top; }
.ai-table th { background: rgba(242,178,63,.1); color: var(--text); font-weight: 700; white-space: nowrap; }
.ai-table tr:last-child td { border-bottom: 0; }
.ai-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0 !important; padding-top: 12px; border-top: 1px dashed var(--ai-line-2); color: var(--text-muted); font-size: .86rem; }
.ai-flag button { padding: 7px 13px; border: 1px solid var(--gold-line); border-radius: 8px; background: rgba(242,178,63,.1); color: var(--gold-2); font: inherit; font-weight: 680; cursor: pointer; }
.ai-flag button:hover { background: rgba(242,178,63,.18); }
.ai-flag-warn { border-top-style: solid; border-top-color: rgba(255,139,123,.4); color: #ffd3cc; }
.ai-typing { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; color: var(--text-muted); font-size: .9rem; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: .35; animation: ai-dot 1.1s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: .16s; }
.ai-typing i:nth-child(3) { animation-delay: .32s; margin-right: 6px; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

/* Composer */
.ai-composer { flex: none; padding: 6px clamp(14px, 3vw, 28px) max(14px, env(safe-area-inset-bottom)); }
.ai-composer-box { max-width: var(--ai-col); margin: 0 auto; border: 1px solid var(--gold-line); border-radius: 20px; background: rgba(27,12,25,.94); box-shadow: 0 18px 50px rgba(0,0,0,.4); backdrop-filter: blur(10px); transition: border-color .15s ease, box-shadow .15s ease; }
.ai-composer .ai-composer-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,178,63,.16), 0 18px 50px rgba(0,0,0,.4), 0 0 80px rgba(242,178,63,.1); }
.ai-composer-box[data-drop="true"] { border-style: dashed; border-color: var(--gold-2); background: rgba(52,30,34,.94); }
.ai-composer textarea { display: block; width: 100%; max-height: 220px; padding: 16px 20px 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 1.02rem; line-height: 1.55; resize: none; outline: none; }
.ai-composer textarea:focus-visible { outline: none; }
.ai-composer textarea::placeholder { color: var(--text-muted); }
.ai-composer-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px 10px 12px; }
.ai-attach { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px 0 10px; border: 1px solid var(--ai-line-2); border-radius: 19px; background: none; color: var(--text-soft); font: inherit; font-size: .88rem; cursor: pointer; }
.ai-attach:hover { border-color: var(--gold-line); color: var(--text); }
.ai-hint { flex: 1; color: var(--text-muted); font-size: .8rem; text-align: right; }
.ai-send { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; cursor: pointer; box-shadow: 0 8px 22px rgba(233,167,47,.3); transition: transform .15s ease, opacity .15s ease; }
.ai-send svg { stroke-width: 2.3; }
.ai-send:hover:not(:disabled) { transform: translateY(-2px); }
.ai-send:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.ai-send[data-busy="true"] svg { display: none; }
.ai-send[data-busy="true"]::after { content: ""; width: 16px; height: 16px; border: 2px solid rgba(22,11,16,.3); border-top-color: #160b10; border-radius: 50%; animation: ai-spin .7s linear infinite; }
.ai-attachments { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 14px 14px 0; }
.ai-attachments li { position: relative; }
.ai-file { display: inline-flex; align-items: center; gap: 9px; max-width: 260px; min-height: 44px; padding: 7px 12px 7px 9px; border: 1px solid var(--ai-line-2); border-radius: 12px; background: rgba(255,236,214,.04); color: var(--text); font-size: .86rem; }
.ai-file svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--gold-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-file small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: .76rem; }
.ai-msg-files li { min-width: 0; }
.ai-msg-files { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0 0 8px; padding: 0; }
.ai-attachments img { display: block; width: 76px; height: 76px; border: 1px solid var(--ai-line-2); border-radius: 12px; object-fit: cover; }
.ai-attachments button { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--ai-line-2); border-radius: 50%; background: #1f0f1d; color: var(--text); font-size: 15px; line-height: 1; cursor: pointer; }
.ai-composer-error { max-width: var(--ai-col); margin: 10px auto 0; padding: 10px 12px; border-left: 3px solid var(--ai-danger); border-radius: 0 8px 8px 0; background: rgba(255,139,123,.08); color: #ffd3cc; font-size: .92rem; }
.ai-composer-note { max-width: var(--ai-col); margin: 10px auto 0; color: var(--text-muted); font-size: .78rem; text-align: center; }
.ai-chat[data-empty="true"] .ai-composer-note { margin-top: 18px; }

/* Create image: the switch in the composer, the format bar above the text, the picture in the reply */
.ai-mode[aria-pressed="true"] { border-color: var(--gold); background: rgba(242,178,63,.14); color: var(--gold-2); }
.ai-image-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--ai-line); color: var(--text-soft); font-size: .86rem; }
.ai-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--ai-line-2); border-radius: 999px; background: rgba(9,4,9,.5); }
.ai-seg button { min-height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: none; color: var(--text-soft); font: inherit; font-size: .86rem; font-weight: 640; cursor: pointer; }
.ai-seg button small { margin-left: 3px; color: var(--text-muted); font-size: .76rem; font-weight: 500; }
.ai-seg button:hover { color: var(--text); }
.ai-seg button[aria-pressed="true"] { background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; }
.ai-seg button[aria-pressed="true"] small { color: rgba(22,11,16,.72); }
.ai-image-left { margin-left: auto; color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; }
.ai-image-left[data-full="true"] { color: #ffd3cc; }
.ai-made { margin: 0 0 16px; }
.ai-made[data-format="icon"], .ai-making[data-format="icon"] .ai-making-frame { max-width: 340px; }
.ai-made-open { display: block; width: 100%; padding: 0; border: 1px solid var(--ai-line-2); border-radius: 12px; background: #0c050c; overflow: hidden; cursor: zoom-in; line-height: 0; }
.ai-made-open img { display: block; width: 100%; height: auto; }
.ai-made figcaption { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--text-muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.ai-made-save { display: inline-flex; align-items: center; min-height: 36px; margin-left: auto; padding: 0 14px; border: 1px solid var(--gold-line); border-radius: 9px; background: rgba(242,178,63,.1); color: var(--gold-2); font-weight: 680; text-decoration: none; }
.ai-made-save:hover { background: rgba(242,178,63,.18); }
.ai-making { display: grid; gap: 12px; }
.ai-making-frame { aspect-ratio: 16 / 9; border: 1px dashed var(--gold-line); border-radius: 12px; background: linear-gradient(110deg, rgba(242,178,63,.04) 35%, rgba(242,178,63,.14) 50%, rgba(242,178,63,.04) 65%) 0 0 / 240% 100%; animation: ai-sheen 1.9s linear infinite; }
.ai-making[data-format="icon"] .ai-making-frame { aspect-ratio: 1; }
@keyframes ai-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.ai-made-prompt { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ai-line-2); }
.ai-made-prompt summary { width: fit-content; color: var(--text-muted); font-size: .86rem; font-weight: 640; cursor: pointer; }
.ai-made-prompt summary:hover { color: var(--text); }
.ai-answer .ai-made-prompt p { margin: 10px 0; color: var(--text-soft); font-size: .9rem; line-height: 1.6; }
.ai-made-prompt .ai-copy { margin: 0; }

/* Dialogs */
.ai-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--gold-line); border-radius: var(--ai-r2); background: #1f0f1d; color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.ai-dialog::backdrop, .ai-lightbox::backdrop { background: rgba(6,2,6,.78); }
.ai-dialog form { display: grid; gap: 10px; padding: 24px; }
.ai-dialog h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.ai-dialog p { margin: 0; color: var(--text-soft); line-height: 1.55; }
.ai-dialog label { margin-top: 6px; font-size: .9rem; font-weight: 640; }
.ai-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
/* Memory: what the AI has noted about this account, with its switch */
.ai-memory { width: min(520px, calc(100% - 32px)); }
/* Settings: one panel for usage, memory, security and the visitor's data */
.ai-settings { width: min(620px, calc(100% - 32px)); max-height: min(88dvh, 760px); overflow: hidden; }
.ai-settings[open] { display: flex; flex-direction: column; }
.ai-settings-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 12px 24px; }
.ai-settings-tabs { flex: none; display: flex; gap: 4px; margin: 0 24px; padding: 4px; border: 1px solid var(--ai-line); border-radius: 12px; background: rgba(9,4,9,.5); overflow-x: auto; scrollbar-width: none; }
.ai-settings-tabs::-webkit-scrollbar { display: none; }
.ai-settings-tabs button { flex: 1 0 auto; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 8px; background: none; color: var(--text-soft); font: inherit; font-size: .92rem; font-weight: 660; white-space: nowrap; cursor: pointer; }
.ai-settings-tabs button:hover { color: var(--text); }
.ai-settings-tabs button[aria-selected="true"] { background: rgba(242,178,63,.15); color: var(--text); box-shadow: inset 0 0 0 1px rgba(242,178,63,.34); }
.ai-settings-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 24px 24px; scrollbar-width: thin; scrollbar-color: var(--ai-line-2) transparent; }
.ai-settings-body > section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ai-settings-body > section[hidden] { display: none; }
.ai-settings form, .ai-settings #memory-box, .ai-settings #two-codes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0; }
.ai-settings form[hidden], .ai-settings #memory-box[hidden], .ai-settings #two-codes[hidden] { display: none; }
.ai-settings h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.ai-settings #two-status { padding: 10px 12px; border-radius: var(--ai-r1); background: rgba(255,236,214,.05); font-size: .92rem; }
.ai-settings #two-status[data-on="true"] { background: rgba(120,200,140,.1); color: #cfeed7; }
.ai-two-scan { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 16px; align-items: center; margin: 4px 0; }
.ai-two-qr { padding: 6px; border-radius: 12px; background: #fff; line-height: 0; }
.ai-two-qr svg { display: block; width: 100%; height: auto; }
.ai-two-key { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.ai-two-key span { color: var(--text-muted); font-size: .8rem; font-weight: 640; }
.ai-two-key code, .ai-two-codes li { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; letter-spacing: .04em; color: var(--text); overflow-wrap: anywhere; }
.ai-two-key .ai-copy { margin-left: 0; }
.ai-two-key a { color: var(--gold-2); font-size: .88rem; }
.ai-two-codes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r1); background: var(--ai-line-2); overflow: hidden; }
.ai-two-codes li { padding: 10px 14px; background: #160a15; text-align: center; }
.ai-two-turnoff { border: 1px solid var(--ai-line); border-radius: var(--ai-r1); }
.ai-two-turnoff summary { padding: 12px 14px; color: var(--text-soft); font-size: .92rem; font-weight: 620; cursor: pointer; }
.ai-two-turnoff[open] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 14px 14px; }
.ai-two-turnoff[open] summary { padding: 12px 0 2px; }
.ai-data-rows { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; border: 1px solid var(--ai-line); border-radius: var(--ai-r1); background: var(--ai-line); overflow: hidden; }
.ai-data-rows li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: #1f0f1d; }
.ai-data-rows strong { font-size: .95rem; }
.ai-data-rows p { margin-top: 3px; font-size: .86rem; }
.ai-data-rows .ai-button { flex: none; min-height: 42px; padding: 0 16px; font-size: .9rem; }
.ai-dialog .ai-switch { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; padding: 12px 14px; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r1); background: rgba(255,236,214,.04); font-size: .95rem; font-weight: 600; cursor: pointer; }
.ai-dialog .ai-switch input { appearance: none; flex: none; position: relative; width: 44px; min-height: 0; height: 26px; margin: 0; padding: 0; border: 1px solid var(--ai-line-2); border-radius: 999px; background: rgba(9,4,9,.7); cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease); }
.ai-dialog .ai-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform .18s var(--ease), background .18s var(--ease); }
.ai-dialog .ai-switch input:checked { border-color: var(--gold); background: rgba(242,178,63,.28); }
.ai-dialog .ai-switch input:checked::after { background: var(--gold-2); transform: translateX(18px); }
.ai-dialog .ai-switch input:disabled { opacity: .6; cursor: progress; }
.ai-memory-notes { list-style: none; display: grid; gap: 1px; max-height: min(42vh, 340px); margin: 0; padding: 0; border: 1px solid var(--ai-line); border-radius: var(--ai-r1); overflow: auto; background: var(--ai-line); }
.ai-memory-notes li { padding: 10px 14px; background: #1f0f1d; color: var(--text); font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.ai-dialog .ai-memory-empty { padding: 14px; border: 1px dashed var(--ai-line-2); border-radius: var(--ai-r1); font-size: .92rem; }
.ai-dialog .ai-memory-foot { color: var(--text-muted); font-size: .84rem; }
.ai-dialog-actions .ai-button { min-height: 44px; }
.ai-lightbox { max-width: min(96vw, 1200px); max-height: 94vh; padding: 0; border: 0; background: none; overflow: visible; }
.ai-lightbox img { display: block; max-width: min(96vw, 1200px); max-height: 90vh; border-radius: 12px; }
.ai-lightbox .ai-icon-button { position: absolute; top: -46px; right: 0; color: #fff; }

@media (max-width: 980px) {
  .ai-shell { grid-template-columns: 1fr; }
  .ai-side { position: fixed; z-index: 950; top: var(--header-height); bottom: 0; left: 0; width: min(320px, 86vw); background: #120812; backdrop-filter: none; transform: translateX(-102%); transition: transform .22s var(--ease); }
  .ai-shell[data-side="open"] .ai-side { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.5); }
  .ai-backdrop { position: fixed; z-index: 940; inset: var(--header-height) 0 0; background: rgba(6,2,6,.6); }
  #side-toggle { display: inline-grid; }
}
@media (max-width: 620px) {
  .ai-auth { padding: 12px; }
  .ai-auth-intro { padding: 22px 56px 0 18px; }
  .ai-form { padding: 18px 18px 24px; }
  .ai-chat[data-empty="true"] .ai-starters { grid-template-columns: 1fr; }
  .ai-chat[data-empty="true"] .ai-composer { padding-bottom: 24px; }
  .ai-chat[data-empty="true"] .ai-composer textarea { min-height: 76px; }
  .ai-empty { padding-top: 6px; }
  .ai-hint { display: none; }
  .ai-image-bar { padding-left: 14px; }
  .ai-project-strip { padding-left: 14px; }
  #image-bar-label { display: none; }
  .ai-composer-row { justify-content: flex-start; }
  .ai-composer-row .ai-send { margin-left: auto; }
  .ai-answer { padding: 15px 15px 17px; }
  .ai-msg-user { max-width: 92%; }
  .ai-settings { width: calc(100% - 20px); max-height: 92dvh; }
  .ai-settings-head { padding: 14px 10px 10px 18px; }
  .ai-settings-tabs { margin: 0 14px; gap: 2px; padding: 3px; }
  .ai-settings-tabs button { flex: 1 1 0; min-width: 0; padding: 8px 4px; font-size: .84rem; }
  .ai-settings-body { padding: 16px 18px 20px; }
  .ai-two-scan { grid-template-columns: 1fr; justify-items: center; }
  .ai-two-qr { width: 190px; }
  .ai-two-key { justify-items: center; text-align: center; }
  .ai-data-rows li { flex-direction: column; align-items: stretch; gap: 10px; }
}
@media (max-width: 400px) {
  .ai-attach:not(.ai-mode) { padding: 0 10px; }
  .ai-attach:not(.ai-mode) span { display: none; }      /* room for Create image beside it */
}
@media (prefers-reduced-motion: reduce) {
  .ai-page *, .ai-page *::before, .ai-page *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .ai-thread { scroll-behavior: auto; }
  /* a loop cannot be shortened to nothing: stop it and show the finished curve with its tip at the top */
  .ai-page .ai-climb, .ai-page .ai-climb-tip, .ai-page .ai-climb-tip::after, .ai-page .ai-making-frame { animation: none !important; }
  .ai-page .ai-rise { display: none; }
}

/* ---------- 1.17: plans, credits, projects ---------- */
/* 1.20: a project is a folder in the list. Opening it shows its chats under it; the chats below never leave. */
.ai-projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin-top: 4px; }
.ai-projects[hidden] { display: none; }
.ai-projects-head, .ai-history-label { display: flex; align-items: center; justify-content: space-between; min-height: 34px; margin: 0; padding: 0 2px 0 12px; color: var(--text-muted); font-size: .76rem; font-weight: 640; }
.ai-history-label { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--ai-line); }
.ai-history-label[hidden] { display: none; }
.ai-history-label + ul .ai-history-group:first-child { padding-top: 4px; }
.ai-history .ai-projects-head .ai-icon-button { display: inline-grid; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--ai-r1); overflow: visible; }
.ai-history .ai-projects-head .ai-icon-button:hover { border-color: var(--ai-line-2); background: rgba(255,236,214,.04); }
.ai-projects-empty { margin: 0; padding: 4px 12px 2px; color: var(--text-muted); font-size: .84rem; line-height: 1.45; }
.ai-folder-row { display: flex; align-items: center; min-width: 0; border-radius: 9px; }
.ai-folder-row:hover { background: rgba(255,236,214,.05); }
.ai-history .ai-folder-toggle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 9px 4px 9px 8px; background: none; overflow: hidden; }
.ai-history .ai-folder-toggle:hover { background: none; }
.ai-folder-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-folder-toggle small { margin-left: auto; padding-left: 6px; color: var(--text-muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.ai-folder-toggle svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-folder-toggle svg:first-child { width: 12px; height: 12px; stroke-width: 2.6; color: var(--text-muted); transition: transform .16s var(--ease); }
.ai-folder[data-open="true"] > .ai-folder-row svg:first-child { transform: rotate(90deg); }
.ai-folder[data-open="true"] > .ai-folder-row .ai-folder-toggle { color: var(--text); }
.ai-folder[data-here="true"] > .ai-folder-row .ai-folder-toggle svg:nth-child(2) { color: var(--gold); }
.ai-history .ai-folder-edit { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin-right: 2px; padding: 0; border-radius: 8px; color: var(--text-muted); opacity: 0; overflow: visible; }
.ai-history .ai-folder-edit:hover { background: rgba(255,236,214,.08); color: var(--text); }
.ai-folder-row:hover .ai-folder-edit, .ai-folder-row:focus-within .ai-folder-edit, .ai-folder[data-open="true"] > .ai-folder-row .ai-folder-edit { opacity: 1; }
@media (hover: none) { .ai-history .ai-folder-edit { opacity: 1; } }
.ai-folder-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ai-history .ai-folder-chats { margin: 0 0 8px 13px; padding-left: 7px; border-left: 1px solid var(--ai-line-2); animation: ai-folder-in .18s ease-out both; }
.ai-history .ai-folder-chats[hidden] { display: none; }
.ai-history .ai-folder-chats button { padding: 8px 10px; font-size: .9rem; }
.ai-history .ai-folder-new { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.ai-history .ai-folder-new:hover { color: var(--text); }
.ai-folder-new svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ai-folder-new span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ai-folder-empty { padding: 4px 10px 6px; color: var(--text-muted); font-size: .84rem; line-height: 1.45; }
@keyframes ai-folder-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ai-history .ai-folder-chats { animation: none; } .ai-folder-toggle svg:first-child { transition: none; } }
/* Where the chat on screen is filed: on the button in its header, and above the message box while one is being started in a project. */
.ai-chat-head #chat-move[data-filed="true"] { display: inline-flex; align-items: center; gap: 7px; width: auto; max-width: min(38vw, 220px); padding: 0 12px 0 10px; border-color: var(--ai-line-2); color: var(--text); font: inherit; font-size: .84rem; }
.ai-chat-head #chat-move[hidden] { display: none; }
#chat-move svg { flex: none; }
#chat-move[data-filed="true"] svg { width: 16px; height: 16px; color: var(--gold); }
#chat-move-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-move-name[hidden] { display: none; }
.ai-project-strip { display: flex; align-items: center; gap: 9px; padding: 9px 10px 9px 20px; border-bottom: 1px solid var(--ai-line); color: var(--text-soft); font-size: .86rem; }
.ai-project-strip[hidden] { display: none; }
.ai-project-strip > svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linejoin: round; }
.ai-project-strip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-project-strip b { color: var(--text); font-weight: 640; }
.ai-project-strip button { display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; }
.ai-project-strip button:hover { background: rgba(255,236,214,.08); color: var(--text); }
.ai-project-strip button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.ai-plan-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--ai-line-2); border-radius: 12px; background: rgba(9,4,9,.4); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ai-plan-chip[hidden] { display: none; }
.ai-plan-chip:hover { border-color: var(--gold-line); }
.ai-plan-chip span { display: grid; min-width: 0; }
.ai-plan-chip b { font-size: .9rem; font-weight: 660; }
.ai-plan-chip small { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.ai-plan-chip[data-low="true"] small { color: #ffd3cc; }
.ai-plan-chip i { flex: none; padding: 5px 10px; border-radius: 999px; background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; font-size: .8rem; font-style: normal; font-weight: 700; }
.ai-plan-chip[data-paid="true"] i { background: none; border: 1px solid var(--ai-line-2); color: var(--text-soft); font-weight: 600; }

.ai-composer-upgrade { margin: 8px 0 0; }
.ai-composer-upgrade[hidden] { display: none; }
.ai-composer-upgrade .ai-button { min-height: 40px; padding: 0 16px; font-size: .92rem; }
.ai-seg button[data-locked="true"]::after { content: "Pro"; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--gold-line); border-radius: 999px; color: var(--gold); font-size: .68rem; font-weight: 700; }

.ai-dialog textarea, .ai-dialog select { width: 100%; padding: 12px 14px; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r1); background: rgba(9,4,9,.55); color: var(--text); font: inherit; font-size: 1rem; }
.ai-dialog textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.ai-dialog select { min-height: 50px; }
.ai-dialog label small { color: var(--text-muted); font-weight: 500; }
.ai-dialog-left { margin-right: auto; }
.ai-plan-costs { font-size: .88rem; color: var(--text-muted) !important; }
.ai-plan-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-plan-actions .ai-button { min-height: 44px; padding: 0 16px; font-size: .94rem; }
.ai-plan-actions .ai-button[hidden] { display: none; }

.ai-plans { width: min(1000px, calc(100% - 32px)); max-height: min(92dvh, 860px); overflow: hidden; }
.ai-plans[open] { display: flex; flex-direction: column; }
.ai-plans-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 4px 24px 24px; scrollbar-width: thin; scrollbar-color: var(--ai-line-2) transparent; }
.ai-bill { justify-self: center; display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--ai-line-2); border-radius: 999px; background: rgba(9,4,9,.5); }
.ai-bill button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: var(--text-soft); font: inherit; font-size: .94rem; font-weight: 640; cursor: pointer; }
.ai-bill button:hover { color: var(--text); }
.ai-bill button[aria-pressed="true"] { background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; }
.ai-bill small { padding: 2px 8px; border-radius: 999px; background: rgba(120,200,140,.16); color: #cfeed7; font-size: .74rem; font-weight: 700; }
.ai-bill small[hidden] { display: none; }
.ai-bill button[aria-pressed="true"] small { background: rgba(22,11,16,.16); color: #160b10; }
.ai-plan-cards { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.ai-plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 20px; border: 1px solid var(--ai-line-2); border-radius: var(--ai-r2); background: var(--ai-panel); }
.ai-plan[data-plan="pro"] { border-color: rgba(242,178,63,.62); background: linear-gradient(180deg, rgba(242,178,63,.13), rgba(242,178,63,.03) 46%), var(--ai-raised); box-shadow: 0 18px 44px rgba(0,0,0,.34); }
.ai-plan[data-plan="enterprise"] { background: var(--ai-raised); }
.ai-plan[data-current="true"] { outline: 2px solid rgba(120,200,140,.5); outline-offset: 2px; }
.ai-plan h3 { margin: 0; font-size: 1.24rem; letter-spacing: -.02em; }
.ai-plans .ai-plan-for { color: var(--text-muted); font-size: .9rem; }
.ai-plans .ai-plan-tag { position: absolute; top: -11px; right: 16px; margin: 0; padding: 3px 11px; border-radius: 999px; background: linear-gradient(135deg, #ffd16c, #e9a72f); color: #160b10; font-size: .76rem; font-weight: 700; }
.ai-plans .ai-plan-price { display: flex; align-items: baseline; gap: 7px; margin-top: 10px; color: var(--text); }
.ai-plan-price b { font-size: 2rem; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ai-plan-price span { color: var(--text-muted); font-size: .92rem; }
.ai-plans .ai-plan-credits { color: var(--gold); font-size: .98rem; font-weight: 680; }
.ai-plans .ai-plan-sub { min-height: 1.4em; color: var(--text-muted); font-size: .84rem; }
.ai-plan-list { list-style: none; flex: 1; display: grid; align-content: start; gap: 9px; margin: 12px 0 18px; padding: 0; color: var(--text-soft); font-size: .94rem; }
.ai-plan-list li { position: relative; padding-left: 26px; line-height: 1.4; }
.ai-plan-list li::before { content: ""; position: absolute; left: 3px; top: .28em; width: 11px; height: 6px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
.ai-plan .ai-button { width: 100%; min-height: 46px; }
.ai-plan .ai-button svg { width: 17px; height: 17px; }
.ai-plans .ai-plans-note { color: var(--text-muted); font-size: .86rem; }
.ai-plans-note a { color: var(--text-soft); }
@media (max-width: 860px) {
  .ai-plan-cards { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ai-plans { width: calc(100% - 20px); }
  .ai-plans-body { padding: 4px 16px 20px; }
  .ai-plan-list { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .ai-plan .ai-button, .ai-bill button { transition: none; } }

/* ---------- 1.18: panels ease in; Settings with a side menu and a plan card; Enterprise teams ---------- */
@keyframes ai-panel-in { from { opacity: 0; transform: translateY(18px) scale(.972); } to { opacity: 1; transform: none; } }
@keyframes ai-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ai-section-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-dialog[open], .ai-lightbox[open] { animation: ai-panel-in .3s cubic-bezier(.2, .9, .25, 1) both; }
.ai-dialog[open]::backdrop, .ai-lightbox[open]::backdrop { animation: ai-backdrop-in .26s ease-out both; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ai-menu:not([hidden]) { animation: ai-section-in .16s ease-out both; }
.ai-settings-body > section:not([hidden]) { animation: ai-section-in .24s ease-out both; }
.ai-plans[open] .ai-plan { animation: ai-section-in .36s ease-out both; }
.ai-plans[open] .ai-plan:nth-child(1) { animation-delay: .06s; }
.ai-plans[open] .ai-plan:nth-child(2) { animation-delay: .12s; }
.ai-plans[open] .ai-plan:nth-child(3) { animation-delay: .18s; }

.ai-page .ai-settings:focus-visible, .ai-page .ai-plans:focus-visible, .ai-settings:focus, .ai-plans:focus { outline: none; }
.ai-settings { width: min(920px, calc(100% - 32px)); height: min(680px, 90dvh); max-height: none; overflow: hidden; }
.ai-settings[open] { display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.ai-set-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.ai-set-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; padding: 24px 12px 16px; border-right: 1px solid var(--ai-line); background: rgba(9,4,9,.42); overflow-y: auto; scrollbar-width: none; }
.ai-set-side h2 { padding: 0 12px; font-size: 1.14rem; }
.ai-settings-tabs { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 3px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; overflow: visible; }
.ai-settings-tabs button { display: flex; align-items: center; gap: 11px; flex: none; width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px; font-size: .95rem; font-weight: 620; text-align: left; transition: background .16s var(--ease), color .16s var(--ease); }
.ai-settings-tabs button[hidden] { display: none; }
.ai-settings-tabs button svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .78; }
.ai-settings-tabs button:hover { background: rgba(255,236,214,.05); }
.ai-settings-tabs button[aria-selected="true"] { background: rgba(242,178,63,.14); box-shadow: inset 0 0 0 1px rgba(242,178,63,.3); }
.ai-settings-tabs button[aria-selected="true"] svg { color: var(--gold); opacity: 1; }
.ai-set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ai-dialog .ai-set-title { flex: none; padding: 26px 68px 4px 30px; color: var(--text); font-size: 1.34rem; font-weight: 720; letter-spacing: -.025em; line-height: 1.2; }
.ai-settings-body { padding: 16px 30px 30px; }
.ai-settings-body > section { gap: 16px; }
.ai-dialog .ai-set-foot { color: var(--text-muted); font-size: .86rem; }
.ai-settings #meter, .ai-settings #two-off, .ai-settings #two-setup, .ai-settings #two-codes, .ai-settings #memory-box { padding: 18px; border: 1px solid var(--ai-line); border-radius: var(--ai-r2); background: rgba(255,236,214,.03); }
.ai-settings #meter { margin-top: 0; }

.ai-plan-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; border: 1px solid rgba(242,178,63,.36); border-radius: var(--ai-r2); background: radial-gradient(120% 150% at 100% 0%, rgba(242,178,63,.17), rgba(242,178,63,0) 60%), var(--ai-raised); }
.ai-plan-hero[data-plan="free"] { border-color: var(--ai-line-2); background: var(--ai-raised); }
.ai-plan-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ai-plan-hero-name { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; }
.ai-settings .ai-plan-hero h3 { font-size: 1.32rem; letter-spacing: -.02em; }
.ai-plan-hero-name p { font-size: .92rem; }
.ai-pill { justify-self: start; padding: 3px 10px; border: 1px solid var(--ai-line-2); border-radius: 999px; color: var(--text-soft); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.ai-pill[data-tone="good"] { border-color: rgba(120,200,140,.42); background: rgba(120,200,140,.12); color: #cfeed7; }
.ai-pill[data-tone="warn"] { border-color: rgba(242,178,63,.46); background: rgba(242,178,63,.12); color: var(--gold-2); }
.ai-plan-count { flex: none; display: grid; justify-items: end; text-align: right; }
.ai-plan-count b { color: var(--text); font-size: 2.7rem; font-weight: 740; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ai-plan-count span { margin-top: 4px; color: var(--text-muted); font-size: .84rem; }
.ai-plan-hero .ai-meter { margin: 0; }
.ai-plan-hero .ai-meter-track { height: 9px; border-radius: 5px; }
.ai-plan-hero .ai-meter-track i { border-radius: 5px; }
.ai-cost-tiles { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; }
.ai-cost-tiles li { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--ai-line); border-radius: var(--ai-r1); background: rgba(255,236,214,.03); }
.ai-cost-tiles b { font-size: .98rem; font-weight: 680; }
.ai-cost-tiles span { color: var(--text-muted); font-size: .84rem; }

.ai-invites { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.ai-invites[hidden] { display: none; }
.ai-invites li { display: grid; gap: 12px; padding: 16px; border: 1px solid rgba(120,200,140,.42); border-radius: var(--ai-r2); background: rgba(120,200,140,.08); }
.ai-invites strong { overflow-wrap: anywhere; }
.ai-invites div { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-invites .ai-button { min-height: 42px; padding: 0 16px; font-size: .92rem; }
.ai-settings .ai-team-form { gap: 8px; padding: 18px; border: 1px solid var(--ai-line); border-radius: var(--ai-r2); background: rgba(255,236,214,.03); }
.ai-team-form label { margin-top: 0; }
.ai-team-row { display: flex; gap: 10px; }
.ai-team-row input { flex: 1; min-width: 0; }
.ai-team-row .ai-button { flex: none; }
.ai-team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.ai-team-head span { color: var(--text-muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.ai-team-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.ai-team-list:empty { display: none; }
.ai-team-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ai-line); border-radius: var(--ai-r1); background: rgba(9,4,9,.3); animation: ai-section-in .22s ease-out both; }
.ai-team-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(242,178,63,.16); color: var(--gold-2); font-size: .95rem; font-weight: 700; text-transform: uppercase; }
.ai-team-who { flex: 1; display: grid; min-width: 0; }
.ai-team-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .94rem; font-weight: 640; }
.ai-team-who small { color: var(--text-muted); font-size: .82rem; }
.ai-team-list .ai-pill { flex: none; }
.ai-team-list .ai-button { flex: none; min-height: 36px; padding: 0 12px; font-size: .84rem; }
.ai-plan-chip[data-invite="true"] i { background: rgba(120,200,140,.2); border: 1px solid rgba(120,200,140,.5); color: #cfeed7; }

@media (max-width: 780px) {
  .ai-settings { width: calc(100% - 16px); height: min(92dvh, 780px); }
  .ai-settings[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ai-set-side { gap: 12px; padding: 18px 14px 12px; border-right: 0; border-bottom: 1px solid var(--ai-line); overflow: visible; }
  .ai-set-side h2 { padding: 0 4px; }
  /* On a phone the menu is a bar of equal columns, icon above the word, so every entry is in sight without scrolling. */
  .ai-settings-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 4px; margin: 0; padding: 0; overflow: hidden; }
  .ai-settings-tabs button { flex-direction: column; justify-content: center; gap: 5px; width: auto; min-width: 0; min-height: 56px; padding: 8px 2px 7px; border-radius: 12px; font-size: .7rem; font-weight: 640; text-align: center; white-space: nowrap; overflow: hidden; }
  .ai-settings-tabs button svg { width: 19px; height: 19px; }
  .ai-dialog .ai-set-title { display: none; }
  .ai-settings-body { padding: 16px 16px 24px; }
  .ai-plan-hero { padding: 16px; }
  .ai-plan-count b { font-size: 2.2rem; }
  .ai-team-row { flex-direction: column; }
  /* The address gets the whole first line; its state and the button sit on a second one. */
  .ai-team-list li { flex-wrap: wrap; row-gap: 10px; }
  .ai-team-who { flex: 1 1 calc(100% - 48px); }
  .ai-team-list .ai-pill { margin-left: 48px; margin-right: auto; }
  .ai-plan-hero-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dialog[open], .ai-lightbox[open], .ai-dialog[open]::backdrop, .ai-lightbox[open]::backdrop, .ai-menu:not([hidden]), .ai-settings-body > section:not([hidden]), .ai-plans[open] .ai-plan, .ai-team-list li { animation: none; }
}

/* ---------- 1.19: the Account tab (address, password, devices) ---------- */
.ai-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; border: 1px solid var(--ai-line); border-radius: var(--ai-r2); background: rgba(255,236,214,.03); }
.ai-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-card-head > div { display: grid; gap: 3px; min-width: 0; }
.ai-card-head p { font-size: .92rem; overflow-wrap: anywhere; }
.ai-card-head .ai-button { flex: none; min-height: 42px; padding: 0 16px; font-size: .9rem; }
.ai-card form { padding-top: 14px; border-top: 1px solid var(--ai-line); animation: ai-section-in .22s ease-out both; }
.ai-settings .ai-card form p { font-size: .92rem; }
.ai-dialog .ai-card-hint { margin-top: -4px; color: var(--text-muted); font-size: .84rem; }
.ai-dialog .ai-card-done { padding: 10px 12px; border-radius: var(--ai-r1); background: rgba(120,200,140,.1); color: #cfeed7; font-size: .92rem; }
.ai-card-done[hidden] { display: none; }
@media (max-width: 780px) {
  .ai-card-head { flex-direction: column; align-items: stretch; }
  .ai-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ai-card form { animation: none; } }

/* 1.21: a subscriber changes plan in the plan window */
.ai-plans-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; padding: 12px 14px 12px 16px; border: 1px solid var(--gold-line); border-radius: 14px; background: rgba(242,178,63,.07); }
.ai-plans-status[hidden], .ai-plans-done[hidden] { display: none; }
.ai-plans-status p { flex: 1 1 280px; margin: 0; color: var(--text); font-size: .93rem; line-height: 1.5; }
.ai-plans-status .ai-button { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.ai-plans-done { margin: 0 0 16px; padding: 11px 16px; border: 1px solid rgba(120,200,140,.45); border-radius: 12px; background: rgba(120,200,140,.1); color: #d8f2de; font-size: .93rem; }
.ai-plan #plan-cancel-button { margin-top: auto; color: var(--text-soft); }
.ai-plan #plan-cancel-button[hidden] { display: none; }
.ai-plans-note .ai-link { font-size: inherit; }
.ai-plan .ai-button[data-go="change"] svg { display: none; }   /* a change made here does not leave the page */
