/* ============================================================
   «Мой лимит» — the SONYA glass card (2026-11-22).
   «купил подписку — и пусть SONYA считает, сколько осталось видео; меню-стекло».

   Puffy glass like the tariff cards / Streamer templates. Palette is the
   SONYA Editor one only (--ed-*, editor/editor.css): pearl #FEFDFD,
   #D0CDD2, cold lavender-grey #AFADBE, accent #877FC7, #3A3A47, graphite
   #171923. No gold, no new colours. Accent only on the progress fill and
   the focus ring.

   Pairs with quota-glass.js. Every rule is scoped to .sq-*; the light
   theme sets colours with !important because styles.css forces
   `[data-theme="light"] * { color:#0a0a0a !important }`.
   ============================================================ */

.sq-card,
.sq-launch {
	/* --ed-* dark values */
	--sq-text: #EEEDF4;
	--sq-text-2: #AFADBE;
	--sq-text-3: rgba(175, 173, 190, 0.62);
	--sq-accent: #877FC7;
	--sq-accent-soft: rgba(135, 127, 199, 0.32);
	--sq-accent-glow: rgba(135, 127, 199, 0.55);
	--sq-fill: linear-gradient(155deg, rgba(190, 188, 215, 0.12) 0%, rgba(30, 30, 40, 0.34) 38%, rgba(6, 6, 10, 0.62) 100%);
	--sq-rim: linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(214, 212, 236, 0.5) 18%, rgba(175, 173, 190, 0.22) 42%,
		rgba(150, 142, 220, 0.7) 64%, rgba(214, 212, 236, 0.35) 82%, rgba(255, 255, 255, 0.9) 100%);
	--sq-puff:
		inset 0 1px 0 rgba(255, 255, 255, 0.16),
		inset 0 0 26px rgba(135, 127, 199, 0.08),
		inset 0 -18px 30px -20px rgba(5, 6, 12, 0.8),
		inset -21.48px -21.48px 10.74px -21.48px rgba(5, 6, 12, 0.5),
		inset 21.48px 21.48px 10.74px -21.48px rgba(226, 224, 248, 0.28);
	--sq-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 12px 26px -12px rgba(0, 0, 0, 0.85), 0 0 18px -4px rgba(196, 192, 245, 0.2);
	--sq-track: rgba(58, 58, 71, 0.5);
	--sq-track-rim: rgba(175, 173, 190, 0.14);
	--sq-btn: linear-gradient(155deg, rgba(200, 198, 228, 0.2) 0%, rgba(40, 40, 52, 0.38) 40%, rgba(8, 8, 12, 0.58) 100%);
	--sq-btn-ink: #EEEDF4;
	--sq-cta: #EEEDF4;
	--sq-cta-ink: #171923;
	font-family: var(--font-body, 'Onest', system-ui, sans-serif);
}
[data-theme="light"] .sq-card,
[data-theme="light"] .sq-launch {
	/* --ed-* light values */
	--sq-text: #2E2C3B;
	--sq-text-2: #6D6A80;
	--sq-text-3: #9895A9;
	--sq-accent-soft: rgba(135, 127, 199, 0.24);
	--sq-accent-glow: rgba(135, 127, 199, 0.35);
	--sq-fill: linear-gradient(155deg, rgba(254, 253, 253, 0.86) 0%, rgba(254, 253, 253, 0.5) 40%, rgba(208, 205, 210, 0.46) 100%);
	--sq-rim: linear-gradient(140deg, #FFFFFF 0%, rgba(208, 205, 210, 0.75) 22%, rgba(175, 173, 190, 0.45) 45%,
		rgba(135, 127, 199, 0.32) 64%, rgba(208, 205, 210, 0.7) 82%, #FFFFFF 100%);
	--sq-puff:
		inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
		inset 0 0 0 1px rgba(255, 255, 255, 0.45),
		inset 0 0 28px rgba(255, 255, 255, 0.38),
		inset 0 -22px 34px -20px rgba(110, 106, 130, 0.3),
		inset 0 10px 18px -12px rgba(255, 255, 255, 0.7);
	--sq-shadow: 0 2px 4px rgba(110, 106, 130, 0.1), 0 10px 22px -12px rgba(110, 106, 130, 0.35);
	--sq-track: rgba(208, 205, 210, 0.55);
	--sq-track-rim: rgba(175, 173, 190, 0.38);
	--sq-btn: radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 64%), rgba(208, 205, 210, 0.4);
	--sq-btn-ink: #2E2C3B;
	--sq-cta: #171923;
	--sq-cta-ink: #FEFDFD;
}

/* ─────────────── The card (account menu, Mini App) ─────────────── */
.sq-card {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 16px 14px;
	border-radius: 22px;
	color: var(--sq-text);
	background:
		radial-gradient(120% 70% at 50% -24%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 60%),
		var(--sq-fill);
	box-shadow: var(--sq-puff), var(--sq-shadow);
	text-align: left;
}
[data-theme="light"] .sq-card {
	background:
		radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 64%),
		var(--sq-fill);
}
/* the iridescent rim: a 1px gradient ring drawn with a mask */
.sq-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	padding: 1px;
	border-radius: inherit;
	background: var(--sq-rim);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0.55;
	pointer-events: none;
}
[data-theme="light"] .sq-card::before { opacity: 0.9; }

.sq-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.sq-plan {
	font-family: var(--font-display, 'Sora', system-ui, sans-serif);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--sq-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sq-tag {
	flex: none;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--sq-text-2);
	background: var(--sq-btn);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px var(--sq-track-rim);
}

.sq-count { display: flex; flex-direction: column; gap: 2px; }
.sq-count-label { font-size: 11.5px; color: var(--sq-text-3); letter-spacing: 0.01em; }
.sq-count-main { display: flex; align-items: baseline; gap: 7px; }
.sq-left {
	font-family: var(--font-display, 'Sora', system-ui, sans-serif);
	font-size: 34px;
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	color: var(--sq-text);
}
.sq-of { font-size: 13.5px; color: var(--sq-text-2); }

/* progress: what is LEFT, a lavender glass bead in a recessed track */
.sq-bar {
	position: relative;
	height: 8px;
	border-radius: 999px;
	background: var(--sq-track);
	box-shadow: inset 0 1px 2px rgba(5, 6, 12, 0.35), inset 0 0 0 1px var(--sq-track-rim);
	overflow: hidden;
}
[data-theme="light"] .sq-bar { box-shadow: inset 0 1px 2px rgba(110, 106, 130, 0.25), inset 0 0 0 1px var(--sq-track-rim); }
.sq-bar > i {
	position: absolute;
	inset: 0 auto 0 0;
	width: calc(var(--sq-p, 0) * 100%);
	min-width: 8px;
	border-radius: inherit;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%),
		linear-gradient(90deg, #AFADBE 0%, var(--sq-accent) 100%);
	box-shadow: 0 0 10px -1px var(--sq-accent-glow);
	transform-origin: left center;
	transition: width 520ms cubic-bezier(0.23, 1, 0.32, 1);
}
.sq-bar.is-zero > i { min-width: 0; width: 0; }

.sq-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.sq-note { font-size: 12px; line-height: 1.35; color: var(--sq-text-2); }
.sq-note b { font-weight: 600; color: var(--sq-text); }

/* buttons: quiet glass pill; the «Продлить» one when nothing is left = pearl (dark) / graphite (light) CTA */
.sq-btn {
	flex: none;
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	margin: 0;
	cursor: pointer;
	padding: 8px 14px;
	border-radius: 999px;
	font: 600 12.5px/1 var(--font-body, 'Onest', system-ui, sans-serif);
	color: var(--sq-btn-ink);
	background: var(--sq-btn);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px var(--sq-track-rim), 0 6px 14px -8px rgba(5, 6, 12, 0.6);
	transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background 200ms ease;
}
.sq-btn:hover { transform: translateY(-1px); }
.sq-btn:active { transform: translateY(0) scale(0.97); }
.sq-btn:focus-visible { outline: 2px solid var(--sq-accent); outline-offset: 2px; }
.sq-btn.is-cta {
	color: var(--sq-cta-ink);
	background:
		radial-gradient(120% 90% at 50% -30%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 62%),
		var(--sq-cta);
	box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.5), inset 0 -10px 16px -12px rgba(5, 6, 12, 0.5), 0 10px 20px -10px rgba(5, 6, 12, 0.6);
}
[data-theme="light"] .sq-btn { color: var(--sq-btn-ink) !important; }
[data-theme="light"] .sq-btn.is-cta { color: var(--sq-cta-ink) !important; box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), inset 0 -10px 16px -12px rgba(1, 1, 2, 0.55), 0 10px 20px -10px rgba(46, 44, 59, 0.55); }

.sq-others { list-style: none; margin: 2px 0 0; padding: 10px 0 0; display: flex; flex-direction: column; gap: 6px;
	border-top: 1px solid var(--sq-track-rim); }
.sq-others li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sq-text-2); }
.sq-others li b { font-weight: 600; color: var(--sq-text); font-variant-numeric: tabular-nums; }

/* unlimited (admins / legacy Pro) */
.sq-card.is-unlimited .sq-left { font-size: 30px; }
/* loading shimmer before the first answer */
.sq-card.is-loading .sq-left,
.sq-card.is-loading .sq-of { color: transparent; border-radius: 8px; background: var(--sq-track); }
.sq-card.is-loading .sq-left { min-width: 46px; }

/* light theme: explicit colours (styles.css forces #0a0a0a on everything) */
[data-theme="light"] .sq-card,
[data-theme="light"] .sq-plan,
[data-theme="light"] .sq-left,
[data-theme="light"] .sq-note b,
[data-theme="light"] .sq-others li b { color: var(--sq-text) !important; }
[data-theme="light"] .sq-tag,
[data-theme="light"] .sq-of,
[data-theme="light"] .sq-note,
[data-theme="light"] .sq-others li { color: var(--sq-text-2) !important; }
[data-theme="light"] .sq-count-label { color: var(--sq-text-3) !important; }
[data-theme="light"] .sq-card.is-loading .sq-left,
[data-theme="light"] .sq-card.is-loading .sq-of { color: transparent !important; }

/* inside the account menu: the card replaces the old plan lines; the menu glass gets denser so the page
   behind (big «SONYA», inputs) no longer reads through the numbers */
[data-theme="dark"] .acct-drop:has(.sq-card) { background: rgba(10, 11, 16, 0.86); backdrop-filter: blur(30px) saturate(140%); -webkit-backdrop-filter: blur(30px) saturate(140%); }
[data-theme="light"] .acct-drop:has(.sq-card) { background: rgba(254, 253, 253, 0.86) !important; }
[data-theme="dark"] .acct-drop .sq-card { --sq-fill: linear-gradient(155deg, rgba(190, 188, 215, 0.12) 0%, rgba(30, 30, 40, 0.6) 38%, rgba(6, 6, 10, 0.8) 100%); }
.acct-drop .sq-card { margin: 2px 0 4px; }
.acct-drop { min-width: 292px; }
.acct-drop-user.has-sq { padding: 10px 6px 4px; gap: 10px; }

/* ─────────────── Next to «Запустить AI» ─────────────── */
.page-footer.has-sq { flex-wrap: wrap; align-items: center; gap: 12px; }
.sq-launch {
	position: relative;
	isolation: isolate;
	flex: 1 1 280px;
	max-width: 440px;
	margin-right: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "count cost" "bar bar";
	align-items: center;
	column-gap: 12px;
	row-gap: 8px;
	padding: 11px 16px 12px;
	border-radius: 20px;
	color: var(--sq-text);
	background:
		radial-gradient(120% 80% at 50% -30%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%),
		var(--sq-fill);
	box-shadow: var(--sq-puff), var(--sq-shadow);
}
[data-theme="light"] .sq-launch {
	background: radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 64%), var(--sq-fill);
}
.sq-launch::before {
	content: ''; position: absolute; inset: 0; z-index: -1; padding: 1px; border-radius: inherit; background: var(--sq-rim);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
	opacity: 0.5; pointer-events: none;
}
[data-theme="light"] .sq-launch::before { opacity: 0.9; }
.sq-launch[hidden] { display: none; }
.sq-launch .sq-l-count { grid-area: count; font-size: 13px; color: var(--sq-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-launch .sq-l-count b {
	font-family: var(--font-display, 'Sora', system-ui, sans-serif);
	font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--sq-text);
	margin-right: 2px;
}
.sq-launch .sq-l-cost { grid-area: cost; font-size: 12px; color: var(--sq-text-2); text-align: right; white-space: nowrap; }
.sq-launch .sq-l-cost b { font-weight: 600; color: var(--sq-text); }
.sq-launch .sq-bar { grid-area: bar; height: 6px; }
.sq-launch.is-unlimited { grid-template-areas: "count cost"; }
.sq-launch .sq-btn { grid-area: cost; justify-self: end; }
.sq-launch.is-short .sq-l-cost { display: none; }
[data-theme="light"] .sq-launch,
[data-theme="light"] .sq-launch .sq-l-count b,
[data-theme="light"] .sq-launch .sq-l-cost b { color: var(--sq-text) !important; }
[data-theme="light"] .sq-launch .sq-l-count,
[data-theme="light"] .sq-launch .sq-l-cost { color: var(--sq-text-2) !important; }

@media (max-width: 720px) {
	.page-footer.has-sq { flex-direction: column; align-items: stretch; }
	.sq-launch { max-width: none; margin-right: 0; flex: none; }
}
@media (max-width: 520px) {
	.sq-launch { grid-template-areas: "count" "bar" "cost"; grid-template-columns: minmax(0, 1fr); row-gap: 7px; }
	.sq-launch .sq-l-cost { text-align: left; }
	.sq-launch.is-short { grid-template-areas: "count cost" "bar bar"; grid-template-columns: minmax(0, 1fr) auto; }
	.sq-launch.is-unlimited { grid-template-areas: "count" "cost"; }
}

@media (prefers-reduced-motion: reduce) {
	.sq-bar > i, .sq-btn { transition: none; }
}
