/* SAI Credits */
.saic-balance { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .35em; }
.saic-balance__free { opacity: .75; font-size: .9em; }
.saic-balance__buy { margin-left: .4em; }

.saic-box { border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; padding: 16px 20px; margin: 0 0 24px; }
.saic-box__title { font-size: .9em; opacity: .7; }
.saic-box__value { font-size: 1.6em; font-weight: 600; line-height: 1.3; }
.saic-box__note { font-size: .9em; opacity: .75; margin-top: 4px; }

.saic-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 0 0 24px; }
.saic-pack { border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.saic-pack__name { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-weight: 600; }
.saic-pack__bonus { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e3f4e8; color: #17643a; font-size: .78em; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.saic-pack__bonus[hidden] { display: none; }
.saic-pack__credits { font-size: 1.15em; }
.saic-pack__price { opacity: .85; }
.saic-pack__buy { margin-top: auto; text-align: center; }
.saic-pack--custom { margin: 0; }
.saic-pack__amount { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15em; }
.saic-pack__amount label { flex: 1 1 auto; min-width: 0; margin: 0; }
.saic-pack__amount input { width: 100%; min-width: 0; padding: 6px 8px; font-size: 1em; }
.saic-pack__switch { display: inline-flex; flex: 0 0 auto; border: 1px solid rgba(127, 127, 127, .45); border-radius: 8px; overflow: hidden; }
.saic-pack__cur, .saic-pack__cur:hover, .saic-pack__cur:focus { min-width: 34px; padding: 6px 8px; border: 0; border-radius: 0; background: transparent; color: inherit; font-size: .9em; line-height: 1.2; cursor: pointer; }
.saic-pack__cur.is-current, .saic-pack__cur.is-current:hover, .saic-pack__cur.is-current:focus { background: #1f2937; color: #fff; }
.saic-alt-total { white-space: nowrap; opacity: .8; }
/* On a phone a pack is one short row: what it is on the left, the button on the right. */
@media (max-width: 480px) {
	.saic-packs { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.saic-pack { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 14px; }
	.saic-pack__name, .saic-pack__amount { grid-column: 1 / -1; }
	.saic-pack__credits, .saic-pack__price { grid-column: 1; }
	.saic-pack__buy { grid-column: 2; grid-row: 2 / span 2; margin: 0; padding: 10px 18px; }
	.saic-pack--custom .saic-pack__buy { grid-row: 3 / span 2; }
	.saic-pack__amount { margin: 4px 0; }
}

.saic-history { width: 100%; }
.saic-history .saic-minus { color: #b32d2e; white-space: nowrap; }
.saic-history .saic-plus { color: #1a7f37; white-space: nowrap; }
.saic-empty { opacity: .75; }
.saic-product-credits { font-weight: 600; }

.saic-upsell { border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; padding: 14px 18px; margin: 16px 0 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.saic-upsell__text { flex: 1 1 260px; }
.saic-upsell__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.saic-upsell__button { display: inline-block; padding: 8px 16px; border: 1px solid currentColor; border-radius: 6px; text-decoration: none; line-height: 1.3; }
.saic-upsell__button--main { background: #1f2937; border-color: #1f2937; color: #fff; }
.saic-upsell__button--main:hover, .saic-upsell__button--main:focus { color: #fff; opacity: .9; }

.saic-model { font-size: .85em; opacity: .7; margin: 0 0 12px; }

.saic-options { display: grid; gap: 14px; margin: 0 0 18px; }
.saic-options__title { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; opacity: .6; margin: 0 0 6px; }
.saic-options__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.saic-options__list--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.saic-option { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 8px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; text-align: center; text-decoration: none; color: inherit; line-height: 1.25; transition: border-color .15s, background-color .15s; }
a.saic-option:hover, a.saic-option:focus { border-color: currentColor; color: inherit; }
.saic-option--current { border-color: #1f2937; box-shadow: inset 0 0 0 1px #1f2937; background: rgba(31, 41, 55, .07); }
.saic-option__name { font-weight: 600; }
.saic-option__note { font-size: .8em; opacity: .7; }
.saic-option__price { font-size: .8em; white-space: nowrap; }
.saic-option__shape { display: block; box-sizing: border-box; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 3px; opacity: .55; margin: 0 0 4px; }
.saic-option__badge { position: absolute; top: 6px; right: 6px; padding: 1px 5px; border-radius: 6px; background: #1f2937; color: #fff; font-size: .68em; font-weight: 600; line-height: 1.5; letter-spacing: .03em; }
/* The choice of a chat model: lower cards, and one line that opens when there are many models. */
.saic-options--chat { gap: 10px; }
.saic-options--chat .saic-option { min-height: 50px; padding: 7px 6px; gap: 1px; }
.saic-picker { margin: 0 0 18px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; }
.saic-picker__summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; line-height: 1.3; }
.saic-picker__summary::-webkit-details-marker { display: none; }
.saic-picker__summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 10px; }
.saic-picker__label { opacity: .65; }
.saic-picker__toggle { flex: none; font-size: .9em; white-space: nowrap; }
.saic-picker__open, .saic-picker__close { text-decoration: underline; text-underline-offset: 3px; }
.saic-picker__toggle::after { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 2px 3px 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.saic-picker[open] .saic-picker__toggle::after { transform: rotate(-135deg); margin-bottom: -1px; }
.saic-picker__close, .saic-picker[open] .saic-picker__open { display: none; }
.saic-picker[open] .saic-picker__close { display: inline; }
.saic-picker .saic-options { margin: 0; padding: 2px 14px 14px; }
@media (prefers-reduced-motion: reduce) { .saic-picker__toggle::after { transition: none; } }
@media (max-width: 480px) {
	.saic-picker__summary { padding: 8px 12px; }
	.saic-picker__current { min-width: 0; }
	.saic-picker__label { display: block; font-size: .8em; }
	.saic-picker__current strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Text that follows a chat needs air between them. */
.mwai-chatbot-container { margin-bottom: 1.6em; }
/* A question mark on the corner of a card opens what the model is and can do. */
.saic-option-wrap { position: relative; display: grid; min-width: 0; }
.saic-option__help, .saic-option__help:hover, .saic-option__help:focus { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; color: inherit; font: inherit; line-height: 1; cursor: pointer; }
.saic-option__help::before { content: '?'; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(127, 127, 127, .6); border-radius: 50%; background: #fff; color: #4b5563; font-size: 11px; font-weight: 700; }
.saic-option__help:hover::before, .saic-option__help[aria-expanded="true"]::before { border-color: #1f2937; background: #1f2937; color: #fff; }
.saic-option__help:focus-visible { outline: 2px solid #1f2937; outline-offset: -3px; }
.saic-about { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(31, 41, 55, .06); font-size: .92em; line-height: 1.45; text-align: left; }
.saic-about strong { display: block; margin: 0 0 2px; }
/* The chat first, the choice of a model right under it. */
.saic-chat-first { scroll-margin-top: 12px; }
.saic-chat-first .mwai-chatbot-container { margin-bottom: 12px; }
/* Long explanations folded under their headings: open on a click, stay in the page for search engines. */
.entry-content details.saic-info, details.saic-info { margin: 0; border-top: 1px solid rgba(127, 127, 127, .3); }
details.saic-info:last-of-type { margin-bottom: 1.5em; border-bottom: 1px solid rgba(127, 127, 127, .3); }
details.saic-info > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; cursor: pointer; font-weight: 600; line-height: 1.3; list-style: none; }
details.saic-info > summary::-webkit-details-marker { display: none; }
details.saic-info > summary::after { content: ''; flex: none; width: 7px; height: 7px; margin: 0 4px 3px 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
details.saic-info[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
details.saic-info > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
details.saic-info > :not(summary) { margin: 0 2px 14px; }
@media (prefers-reduced-motion: reduce) { details.saic-info > summary::after { transition: none; } }

@media (max-width: 480px) {
	.saic-option { padding: 10px 4px; }
	.saic-option__name { font-size: .92em; }
}

.saic-price { white-space: nowrap; }
.saic-price__alt { font-weight: 600; }
