/*
 * Tamraght Forum app layer: install sheet, toast, phone-notifications panel.
 * Caustic Glass (2026-11-17): a frosted glass sheet with the iridescent rim, Fredoka title,
 * glass orbs for the steps and the theme's pearl / glass buttons. Reads the tokens that
 * caustic.css sets on body.lv (day) and body.lv.tmf-night (night).
 */
.tmf-app-sheet {
	--sheet-base: linear-gradient(160deg, rgba(240, 236, 255, .84) 0%, rgba(228, 238, 250, .82) 60%, rgba(236, 246, 248, .84) 100%);
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	z-index: 9990;
	max-width: 440px;
	margin: 0 auto;
	padding: 20px 20px 18px;
	background: var(--glass-dense, linear-gradient(transparent, transparent)), var(--sheet-base);
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	backdrop-filter: blur(22px) saturate(160%);
	color: var(--ink, #1B2244);
	border: 0;
	border-radius: 28px;
	box-shadow: var(--glass-rim, inset 0 1px 0 rgba(255, 255, 255, .95)), 0 30px 60px -24px rgba(45, 50, 125, .55), 0 2px 8px -2px rgba(45, 50, 125, .16);
	font-family: var(--font-body, "Figtree", system-ui, sans-serif);
	transform: translateY(calc(100% + 40px));
	opacity: 0;
	transition: transform .5s cubic-bezier(.2, .9, .25, 1.05), opacity .3s ease;
}
body.tmf-night .tmf-app-sheet {
	--sheet-base: linear-gradient(160deg, rgba(22, 34, 76, .9) 0%, rgba(16, 28, 66, .9) 60%, rgba(18, 38, 80, .9) 100%);
	box-shadow: var(--glass-rim, inset 0 1px 0 rgba(255, 255, 255, .3)), 0 34px 70px -24px rgba(0, 4, 20, .8), 0 0 40px -16px rgba(150, 140, 255, .35);
}
.tmf-app-sheet.is-open { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
	.tmf-app-sheet { transform: none; transition: opacity .2s ease; }
}
/* Phones: sit above the floating tab bar. */
@media (max-width: 760px) {
	body.lv .tmf-app-sheet { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
.tmf-app-sheet__head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.tmf-app-sheet__icon {
	width: 52px;
	height: 52px;
	flex: none;
	border-radius: 15px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 10px 22px -12px rgba(45, 50, 125, .6);
}
.tmf-app-sheet__title {
	margin: 0;
	font-family: var(--font-display, "Fredoka", system-ui, sans-serif);
	font-style: normal;
	font-weight: 600;
	font-size: 1.2rem;
	line-height: 1.12;
	letter-spacing: -.005em;
	color: var(--ink, #1B2244);
}
.tmf-app-sheet__text { margin: 12px 0 0; font-size: .95rem; line-height: 1.5; color: var(--muted, #464C70); }
.tmf-app-sheet__steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: tmfstep; }
.tmf-app-sheet__steps li { counter-increment: tmfstep; display: flex; align-items: center; gap: 12px; font-size: .95rem; line-height: 1.4; color: var(--ink, #1B2244); }
.tmf-app-sheet__steps li::before {
	content: counter(tmfstep);
	flex: none;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--orb, radial-gradient(circle at 30% 25%, #FFFFFF 0%, rgba(255, 255, 255, .4) 35%, rgba(206, 194, 255, .5) 65%, rgba(166, 226, 240, .7) 100%));
	box-shadow: var(--orb-shadow, inset 0 0 0 1px rgba(255, 255, 255, .95), 0 8px 18px -10px rgba(45, 50, 125, .5));
	color: var(--ink, #1B2244);
	font-family: var(--font-display, "Fredoka", system-ui, sans-serif);
	font-weight: 600;
	font-size: .9rem;
}
.tmf-app-sheet__share { width: 20px; height: 20px; margin: 0 4px; flex: none; color: var(--ink, #1B2244); vertical-align: -4px; }
.tmf-app-sheet__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tmf-app-sheet__actions .tmf-btn { flex: 1 1 auto; min-height: 46px; padding: 10px 18px; font-size: 1rem; cursor: pointer; }
.tmf-app-sheet__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .4);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9);
	color: var(--ink, #1B2244);
	cursor: pointer;
	transition: background .3s ease, box-shadow .3s ease;
}
body.tmf-night .tmf-app-sheet__close { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.tmf-app-sheet__close svg { width: 18px; height: 18px; }
.tmf-app-sheet__close:hover { background: var(--pearl, #FFFFFF); color: #1B2244; box-shadow: inset 0 0 0 1px #FFFFFF, 0 8px 20px -10px rgba(200, 120, 220, .6); }
.tmf-app-sheet__close:focus-visible,
.tmf-app-sheet .tmf-btn:focus-visible { outline: 3px solid var(--ink, #1B2244); outline-offset: 3px; }
.tmf-app-sheet__note {
	margin: 12px 0 0;
	padding: 11px 14px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .42);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85);
	color: var(--ink, #1B2244);
	font-size: .88rem;
	line-height: 1.45;
}
body.tmf-night .tmf-app-sheet__note { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }

/* Toast: a small glass pill. */
.tmf-app-toast {
	position: fixed;
	left: 50%;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 9991;
	max-width: calc(100% - 32px);
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--pearl, #FFFFFF);
	color: #1B2244;
	font-family: var(--font-body, "Figtree", system-ui, sans-serif);
	font-weight: 700;
	box-shadow: var(--pearl-shadow, 0 14px 30px -14px rgba(118, 88, 206, .65));
	transform: translate(-50%, 160%);
	opacity: 0;
	transition: transform .4s cubic-bezier(.2, .9, .25, 1.05), opacity .25s ease;
	pointer-events: none;
}
@media (max-width: 760px) {
	body.lv .tmf-app-toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
.tmf-app-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.tmf-app-panel__status { margin: 10px 0 0; font-weight: 700; color: var(--ink, #1B2244); }
.tmf-app-panel__status:empty { display: none; }
.tmf-app-panel__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tmf-app-panel__actions .tmf-btn[hidden] { display: none; }
.tmf-app-panel__actions .tmf-btn[disabled] { opacity: .6; cursor: progress; }

/* Installed app: no tap flash, and room for the iPhone home bar. */
html.tmf-standalone body { -webkit-tap-highlight-color: transparent; padding-bottom: env(safe-area-inset-bottom, 0px); }
