/* FORCE LIGHT MODE — блокируем системную тёмную тему */
:root, html, body { color-scheme: light !important; }

/* =========================================================================
   База: бренд-фон, типографика, корневой layout приложения.
   Зависит от variables.css и reset.css.
   ========================================================================= */

html {
	font-size: 16px;
	background: var(--color-glass-bg-strong);
}

/* ---------- BODY: фирменный пастельный фон ---------- */
body {
	font-family: var(--font-family);
	font-size: var(--fs-base);
	font-weight: var(--fw-regular);
	line-height: var(--lh-normal);
	color: var(--color-text);

	background: var(--bg-brand);
	background-attachment: fixed;        /* Свечения не плывут при скролле */
	min-height: 100vh;
	min-height: 100dvh;

	padding:
		var(--safe-top)
		var(--safe-right)
		0
		var(--safe-left);

	touch-action: manipulation;          /* Запрет двойного тапа на зум */
}

/* ---------- Типографика ---------- */
h1, h2, h3, h4, h5, h6 {
	font-weight: var(--fw-semibold);
	line-height: var(--lh-tight);
	color: var(--color-primary);
	letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }

.h-display { font-size: var(--fs-display); line-height: var(--lh-tight); }

.label {
	font-size: var(--fs-xs);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--color-text-faint);
	font-weight: var(--fw-medium);
}

p { margin-bottom: var(--sp-3); }
p:last-child { margin-bottom: 0; }

.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-small { font-size: var(--fs-sm); }
.text-caption {
	font-size: var(--fs-xs);
	color: var(--color-text-muted);
	line-height: var(--lh-normal);
}

a {
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color var(--t-fast);
}

a:hover  { color: var(--color-accent-hover); }
a:active { color: var(--color-accent-active); }

::selection {
	background-color: var(--color-accent);
	color: var(--color-text-on-accent);
}

/* ---------- Корневой контейнер приложения ---------- */
#app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	width: 100%;
	max-width: var(--app-max-width);
	margin: 0 auto;
	position: relative;
}

/* ---------- Логика экранов (роутер показывает один) ---------- */
[data-screen] {
	display: none;
	flex: 1 1 auto;
	width: 100%;
	flex-direction: column;
}

[data-screen].is-active {
	display: flex;
}

/* ---------- Экран = scroll-контейнер с safe-area сверху ---------- */
.screen {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;            /* для корректного flex-overflow внутри */
	width: 100%;
	padding: var(--sp-5) var(--sp-4);
	gap: var(--sp-3);
	overflow-y: auto;
}

/* Экран чата особый — без боковых отступов и без вертикальной прокрутки
   на корневом уровне (история и инпут управляют своими прокрутками сами) */
.screen--chat {
	padding: 0;
	overflow: hidden;
}

/* ---------- Скрытие корневых полос прокрутки на html/body ---------- */
html, body {
	overflow-x: hidden;
}
