/*
 * Online Test Series — front-end styles.
 * Everything is scoped under .ots-app and the app draws its own light
 * surface, so it stays readable on light and dark themes and does not
 * leak styles into the theme.
 */
.ots-app {
	--ots-brand: #2563eb;
	--ots-brand-ink: #ffffff;
	--ots-ink: #0f172a;
	--ots-ink-2: #334155;
	--ots-muted: #64748b;
	--ots-line: #e2e8f0;
	--ots-surface: #f8fafc;
	--ots-card: #ffffff;
	--ots-radius: 12px;
	--ots-radius-sm: 8px;
	--ots-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
	--ots-focus: 0 0 0 3px rgba(37, 99, 235, .35);

	/* Action colours (also used by the exam screen in Phase 4). */
	--ots-success: #15803d;  --ots-success-bg: #dcfce7;
	--ots-warning: #c2410c;  --ots-warning-bg: #ffedd5;
	--ots-info: #1d4ed8;     --ots-info-bg: #dbeafe;
	--ots-indigo: #3730a3;
	--ots-purple: #7e22ce;   --ots-purple-bg: #f3e8ff;
	--ots-danger: #b91c1c;   --ots-danger-bg: #fee2e2;
	--ots-neutral: #475569;  --ots-neutral-bg: #f1f5f9;

	color: var(--ots-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.ots-app *, .ots-app *::before, .ots-app *::after { box-sizing: border-box; }
.ots-app p { margin: 0 0 .5em; }
.ots-app ul { margin: 0; padding: 0; list-style: none; }
.ots-app a { color: var(--ots-brand); text-decoration: none; box-shadow: none; }
.ots-app a:hover { text-decoration: underline; }
.ots-app svg.ots-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.ots-app [hidden] { display: none !important; }
.ots-app :focus-visible { outline: none; box-shadow: var(--ots-focus); border-radius: 6px; }
.ots-app .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ---------- Typography ---------- */
.ots-app .ots-h2 { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin: 0 0 4px; color: var(--ots-ink); letter-spacing: -.01em; }
.ots-app .ots-h3 { font-size: 1.02rem; font-weight: 650; margin: 0 0 12px; color: var(--ots-ink); }
.ots-app .ots-muted { color: var(--ots-muted); font-size: .9em; }
.ots-app .ots-hint { color: var(--ots-muted); font-size: .85rem; margin: 6px 0 0; }
.ots-app .ots-link { font-weight: 600; }
.ots-app .ots-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82em; background: var(--ots-neutral-bg); padding: 2px 6px; border-radius: 4px; color: var(--ots-ink-2); }

/* ---------- Buttons ---------- */
.ots-app .ots-btn {
	-webkit-appearance: none; appearance: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 18px;
	border: 1px solid transparent; border-radius: var(--ots-radius-sm);
	font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
	text-transform: none; letter-spacing: normal; text-decoration: none; text-shadow: none;
	cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
	background: var(--ots-neutral-bg); color: var(--ots-ink);
}
.ots-app .ots-btn:hover { text-decoration: none; filter: brightness(.95); }
.ots-app .ots-btn:focus-visible { box-shadow: var(--ots-focus); }
.ots-app .ots-btn[disabled], .ots-app .ots-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.ots-app .ots-btn--primary { background: var(--ots-brand); color: var(--ots-brand-ink); }
.ots-app .ots-btn--success { background: var(--ots-success); color: #fff; }
.ots-app .ots-btn--danger { background: var(--ots-danger); color: #fff; }
.ots-app .ots-btn--ghost { background: var(--ots-card); color: var(--ots-ink-2); border-color: var(--ots-line); }
.ots-app .ots-btn--sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.ots-app .ots-btn--block { width: 100%; }
.ots-app .ots-btn.is-loading { pointer-events: none; opacity: .8; }
.ots-app .ots-btn.is-loading::before {
	content: ""; width: 14px; height: 14px; border-radius: 50%;
	border: 2px solid currentColor; border-right-color: transparent;
	animation: ots-spin .7s linear infinite;
}
@keyframes ots-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.ots-app .ots-form { display: flex; flex-direction: column; gap: 16px; }
.ots-app .ots-form--wide { max-width: none; }
.ots-app .ots-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.ots-app .ots-form-actions { display: flex; gap: 12px; margin-top: 4px; }
.ots-app .ots-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ots-app .ots-label { font-weight: 600; font-size: .9rem; color: var(--ots-ink-2); margin: 0; }
.ots-app .ots-optional { font-weight: 400; color: var(--ots-muted); }
.ots-app .ots-input {
	-webkit-appearance: none; appearance: none;
	width: 100%; min-height: 44px; margin: 0; padding: 10px 12px;
	font: inherit; font-size: 1rem; color: var(--ots-ink);
	background: #fff; border: 1px solid #cbd5e1; border-radius: var(--ots-radius-sm);
	box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.ots-app select.ots-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.ots-app .ots-input:focus { outline: none; border-color: var(--ots-brand); box-shadow: var(--ots-focus); }
.ots-app .ots-input[aria-invalid="true"] { border-color: var(--ots-danger); }
.ots-app .ots-password { position: relative; }
.ots-app .ots-password .ots-input { padding-right: 48px; }
.ots-app .ots-password__toggle {
	position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
	width: 40px; height: 36px; padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center;
	border: 0; border-radius: 6px; background: transparent; color: var(--ots-muted); cursor: pointer; box-shadow: none; min-height: 0;
}
.ots-app .ots-password__toggle[aria-pressed="true"] { color: var(--ots-brand); }
.ots-app .ots-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ots-ink-2); cursor: pointer; margin: 0; }
.ots-app .ots-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ots-brand); }
.ots-app .ots-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ots-app .ots-hint--match:empty { display: none; }
.ots-app .ots-hint--match.is-ok { color: var(--ots-success); }
.ots-app .ots-hint--match.is-bad { color: var(--ots-danger); }

/* ---------- Layout helpers ---------- */
.ots-app .ots-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ots-app .ots-row--between { justify-content: space-between; }
.ots-app .ots-row--center { justify-content: center; }
.ots-app .ots-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ots-app .ots-grid-2 > .ots-card { margin-bottom: 0; }
.ots-app .ots-cell-stack { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Alerts & badges ---------- */
.ots-app .ots-alert { border-radius: var(--ots-radius-sm); padding: 12px 14px; margin: 0 0 16px; border: 1px solid; font-size: .93rem; }
.ots-app .ots-alert p:last-child, .ots-app .ots-alert ul:last-child { margin-bottom: 0; }
.ots-app .ots-alert ul { list-style: disc; padding-left: 20px; }
.ots-app .ots-alert--error { background: var(--ots-danger-bg); border-color: #fecaca; color: #7f1d1d; }
.ots-app .ots-alert--success { background: var(--ots-success-bg); border-color: #bbf7d0; color: #14532d; }
.ots-app .ots-alert--info { background: var(--ots-info-bg); border-color: #bfdbfe; color: #1e3a8a; }
.ots-app .ots-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; line-height: 1.6; white-space: nowrap; }
.ots-app .ots-tone-success { background: var(--ots-success-bg); color: var(--ots-success); }
.ots-app .ots-tone-warning { background: var(--ots-warning-bg); color: var(--ots-warning); }
.ots-app .ots-tone-info { background: var(--ots-info-bg); color: var(--ots-info); }
.ots-app .ots-tone-danger { background: var(--ots-danger-bg); color: var(--ots-danger); }
.ots-app .ots-tone-neutral { background: var(--ots-neutral-bg); color: var(--ots-neutral); }

/* ---------- Auth screens ---------- */
.ots-app--auth { display: flex; justify-content: center; padding: 24px 12px; }
.ots-app .ots-auth {
	width: 100%; max-width: 440px; background: var(--ots-card);
	border: 1px solid var(--ots-line); border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	padding: 32px 28px;
}
.ots-app .ots-auth--center { text-align: center; }
.ots-app .ots-auth--center .ots-avatar { margin: 0 auto 12px; }
.ots-app .ots-auth__head { margin-bottom: 20px; }
.ots-app .ots-auth__title { font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; color: var(--ots-ink); line-height: 1.25; }
.ots-app .ots-auth__sub { color: var(--ots-muted); margin: 0; }
.ots-app .ots-auth__foot { text-align: center; margin: 20px 0 0; color: var(--ots-muted); font-size: .93rem; }

/* ---------- Avatar ---------- */
.ots-app .ots-avatar {
	width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--ots-brand); color: var(--ots-brand-ink); font-weight: 700; font-size: .95rem;
}
.ots-app .ots-avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* ---------- Dashboard ---------- */
.ots-app--dashboard { background: var(--ots-surface); border-radius: 16px; padding: 16px; border: 1px solid var(--ots-line); }
.ots-app .ots-dash { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.ots-app .ots-dash__nav {
	background: var(--ots-card); border: 1px solid var(--ots-line); border-radius: var(--ots-radius);
	padding: 12px; position: sticky; top: 24px;
}
.ots-app .ots-dash__user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 14px; border-bottom: 1px solid var(--ots-line); margin-bottom: 8px; }
.ots-app .ots-dash__user-text { display: flex; flex-direction: column; min-width: 0; }
.ots-app .ots-dash__user-text strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ots-app .ots-dash__user-text span { font-size: .8rem; color: var(--ots-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ots-app .ots-dash__toggle { display: none; }
.ots-app .ots-dash__link {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 2px 0;
	border-radius: var(--ots-radius-sm); color: var(--ots-ink-2); font-weight: 550; font-size: .93rem;
}
.ots-app .ots-dash__link:hover { background: var(--ots-neutral-bg); text-decoration: none; color: var(--ots-ink); }
.ots-app .ots-dash__link.is-active { background: #eff6ff; background: color-mix(in srgb, var(--ots-brand) 12%, #fff); color: var(--ots-brand); }
.ots-app .ots-dash__link--logout { color: var(--ots-danger); }
.ots-app .ots-dash__sep { height: 1px; background: var(--ots-line); margin: 8px 4px; }
.ots-app .ots-dash__main { min-width: 0; }

.ots-app .ots-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 16px; }
.ots-app .ots-section-head p { margin: 0; }

.ots-app .ots-card { background: var(--ots-card); border: 1px solid var(--ots-line); border-radius: var(--ots-radius); box-shadow: var(--ots-shadow); margin-bottom: 16px; overflow: hidden; }
.ots-app .ots-card--pad { padding: 20px; }
.ots-app .ots-card__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.ots-app .ots-card__head .ots-h3 { margin: 0; }

.ots-app .ots-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ots-app .ots-stat { background: var(--ots-card); border: 1px solid var(--ots-line); border-radius: var(--ots-radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--ots-shadow); }
.ots-app .ots-stat__icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #eff6ff; background: color-mix(in srgb, var(--ots-brand) 12%, #fff); color: var(--ots-brand); margin-bottom: 6px; }
.ots-app .ots-stat__value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--ots-ink); }
.ots-app .ots-stat__label { color: var(--ots-muted); font-size: .85rem; }

.ots-app .ots-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 16px; border-bottom: 1px solid var(--ots-line); }
.ots-app .ots-bars__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.ots-app .ots-bars__bar { width: 100%; max-width: 28px; background: var(--ots-brand); border-radius: 4px 4px 0 0; }
.ots-app .ots-bars__val { font-size: .72rem; color: var(--ots-muted); order: -1; }

.ots-app .ots-meter { margin-bottom: 12px; }
.ots-app .ots-meter__top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.ots-app .ots-meter__track { height: 8px; background: var(--ots-neutral-bg); border-radius: 999px; overflow: hidden; }
.ots-app .ots-meter__fill { display: block; height: 100%; border-radius: 999px; }
.ots-app .ots-meter__fill.ots-tone-success { background: var(--ots-success); }
.ots-app .ots-meter__fill.ots-tone-danger { background: var(--ots-danger); }
.ots-app .ots-meter__fill.ots-tone-neutral { background: #94a3b8; }

.ots-app .ots-list { padding: 8px 0; }
.ots-app .ots-list__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--ots-line); }
.ots-app .ots-list__item:first-child { border-top: 0; }
.ots-app .ots-list__item > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.ots-app .ots-score { font-weight: 700; white-space: nowrap; }

.ots-app .ots-empty { color: var(--ots-muted); margin: 0; }
.ots-app .ots-empty-state { text-align: center; color: var(--ots-muted); padding: 32px 20px; }
.ots-app .ots-empty-state svg { color: #94a3b8; margin-bottom: 8px; }
.ots-app .ots-empty-state p { margin: 0; }

/* ---------- Tables ---------- */
.ots-app .ots-table-wrap { overflow-x: auto; }
.ots-app .ots-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: .92rem; }
.ots-app .ots-table th, .ots-app .ots-table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--ots-line); text-align: left; vertical-align: middle; background: transparent; }
.ots-app .ots-table thead th { background: var(--ots-surface); color: var(--ots-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.ots-app .ots-table tbody tr:last-child td { border-bottom: 0; }
.ots-app .ots-table td strong { display: block; }
.ots-app .ots-table .ots-num { text-align: right; white-space: nowrap; }
.ots-app .ots-table .ots-actions { text-align: right; white-space: nowrap; }

.ots-app .ots-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--ots-line); }
.ots-app .ots-pagination__info { color: var(--ots-muted); font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.ots-app .ots-dash { grid-template-columns: 1fr; }
	.ots-app .ots-dash__nav { position: static; padding: 8px; }
	.ots-app .ots-dash__user { border-bottom: 0; margin-bottom: 0; padding-bottom: 8px; }
	.ots-app .ots-dash__toggle {
		display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; margin: 0;
		background: var(--ots-neutral-bg); color: var(--ots-ink); border: 0; border-radius: var(--ots-radius-sm);
		font: inherit; font-weight: 600; cursor: pointer; text-transform: none;
	}
	.ots-app .ots-dash__menu { display: none; padding-top: 6px; }
	.ots-app .ots-dash.is-nav-open .ots-dash__menu { display: block; }
	.ots-app .ots-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.ots-app--dashboard { padding: 10px; border-radius: 12px; }
	.ots-app .ots-auth { padding: 24px 18px; }
	.ots-app .ots-form-grid { grid-template-columns: 1fr; }
	.ots-app .ots-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ots-app .ots-stat__value { font-size: 1.25rem; }
	/* Stack table rows as cards on phones. */
	.ots-app .ots-table thead { display: none; }
	.ots-app .ots-table, .ots-app .ots-table tbody, .ots-app .ots-table tr, .ots-app .ots-table td { display: block; width: 100%; }
	.ots-app .ots-table tr { padding: 10px 16px; border-bottom: 1px solid var(--ots-line); }
	.ots-app .ots-table td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
	.ots-app .ots-table td::before { content: attr(data-label); color: var(--ots-muted); font-size: .82rem; text-align: left; }
	.ots-app .ots-table td:not([data-label])::before { content: none; }
	.ots-app .ots-table .ots-num, .ots-app .ots-table .ots-actions { text-align: right; }
	.ots-app .ots-table td strong { display: inline; }
	.ots-app .ots-table .ots-cell-stack { align-items: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
	.ots-app * { transition: none !important; animation: none !important; }
}

/* ======================= Phase 4: tests, detail, result ======================= */
.ots-app .ots-btn--lg { min-height: 52px; font-size: 1.02rem; }
.ots-app .ots-pad-x { padding: 0 20px; }
.ots-app .ots-back { margin: 0 0 12px; }
.ots-app .ots-prose ul { list-style: disc; padding-left: 22px; margin: 0 0 .8em; }
.ots-app .ots-prose ol { list-style: decimal; padding-left: 22px; margin: 0 0 .8em; }
.ots-app .ots-prose li { margin: 4px 0; }
.ots-app .ots-prose p { margin: 0 0 .8em; }

/* Listing */
.ots-app--tests, .ots-app--result { background: var(--ots-surface); border-radius: 16px; padding: 16px; border: 1px solid var(--ots-line); }
.ots-app .ots-tests__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ots-app .ots-tests__head p { margin: 0; }
.ots-app .ots-search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 420px; }
.ots-app .ots-search .ots-input { flex: 1; }
.ots-app .ots-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.ots-app .ots-chips__sep { width: 1px; height: 24px; background: var(--ots-line); margin: 0 4px; }
.ots-app .ots-chip {
	display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
	border-radius: 999px; border: 1px solid var(--ots-line); background: #fff;
	color: var(--ots-ink-2); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.ots-app .ots-chip:hover { border-color: #94a3b8; text-decoration: none; }
.ots-app .ots-chip.is-active { background: var(--ots-ink); border-color: var(--ots-ink); color: #fff; }
.ots-app .ots-chip--soft.is-active { background: var(--ots-brand); border-color: var(--ots-brand); }
.ots-app .ots-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.ots-app .ots-tcard { display: flex; flex-direction: column; background: var(--ots-card); border: 1px solid var(--ots-line); border-radius: var(--ots-radius); overflow: hidden; box-shadow: var(--ots-shadow); transition: box-shadow .15s, transform .15s; }
.ots-app .ots-tcard:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .1); }
.ots-app .ots-tcard__media { position: relative; display: block; aspect-ratio: 16 / 7; background: linear-gradient(135deg, #e0e7ff, #f1f5f9); }
.ots-app .ots-tcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ots-app .ots-tcard__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6366f1; }
.ots-app .ots-tcard__price { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #fff; color: var(--ots-ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.ots-app .ots-tcard__price.is-free { color: var(--ots-success); }
.ots-app .ots-tcard__body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.ots-app .ots-tcard__cat { font-size: .75rem; font-weight: 700; color: var(--ots-brand); text-transform: uppercase; letter-spacing: .04em; }
.ots-app .ots-tcard__title { font-size: 1.02rem; line-height: 1.35; margin: 0; font-weight: 700; }
.ots-app .ots-tcard__title a { color: var(--ots-ink); }
.ots-app .ots-tcard__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ots-muted); font-size: .82rem; }
.ots-app .ots-tcard__meta li { display: inline-flex; align-items: center; gap: 4px; }
.ots-app .ots-tcard__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; }
.ots-app .ots-tgrid--compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Test page */
.ots-app .ots-tdetail__hero { display: flex; gap: 20px; padding: 20px; align-items: center; }
.ots-app .ots-tdetail__thumb { flex: 0 0 200px; }
.ots-app .ots-tdetail__thumb img { width: 100%; height: auto; border-radius: 10px; display: block; }
.ots-app .ots-tdetail__info { flex: 1; min-width: 0; }
.ots-app .ots-tdetail__title { font-size: 1.6rem; line-height: 1.25; margin: 4px 0 12px; color: var(--ots-ink); font-weight: 750; }
.ots-app .ots-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.ots-app .ots-facts li { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 10px; background: var(--ots-surface); border: 1px solid var(--ots-line); min-width: 90px; }
.ots-app .ots-facts strong { font-size: 1.1rem; color: var(--ots-ink); }
.ots-app .ots-facts span { font-size: .75rem; color: var(--ots-muted); }
.ots-app .ots-tdetail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ots-app .ots-tdetail__side { position: sticky; top: 24px; }
.ots-app .ots-start { display: flex; flex-direction: column; gap: 12px; }
.ots-app .ots-start form { display: flex; flex-direction: column; gap: 14px; }
.ots-app .ots-start__lead { font-weight: 650; margin: 0; }
.ots-app .ots-start__price { font-size: 1.8rem; font-weight: 800; margin: 0; color: var(--ots-ink); }
.ots-app .ots-start__agree { align-items: flex-start; }
.ots-app .ots-start__agree input { margin-top: 3px; }

/* Result */
.ots-app .ots-result__crumb { margin: 0 0 4px; }
.ots-app .ots-scorecard { display: grid; grid-template-columns: auto 1fr; gap: 24px; padding: 22px; align-items: center; }
.ots-app .ots-scorecard__main { display: flex; align-items: center; gap: 18px; }
.ots-app .ots-ring {
	--p: 0; width: 112px; height: 112px; border-radius: 50%; flex: 0 0 112px;
	background: conic-gradient(var(--ots-brand) calc(var(--p) * 1%), #e2e8f0 0);
	display: flex; align-items: center; justify-content: center;
}
.ots-app .ots-ring span { width: 86px; height: 86px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; color: var(--ots-ink); }
.ots-app .ots-scorecard__label { margin: 0; color: var(--ots-muted); font-size: .85rem; }
.ots-app .ots-scorecard__score { margin: 0; font-size: 1.2rem; color: var(--ots-ink-2); }
.ots-app .ots-scorecard__score strong { font-size: 2.2rem; color: var(--ots-ink); }
.ots-app .ots-scorecard__rank { margin: 6px 0 0; font-weight: 650; color: var(--ots-brand); }
.ots-app .ots-scorecard__stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.ots-app .ots-scorecard__stats li { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--ots-surface); border: 1px solid var(--ots-line); }
.ots-app .ots-scorecard__stats span { font-size: .75rem; color: var(--ots-muted); }
.ots-app .ots-scorecard__stats strong { font-size: 1.15rem; color: var(--ots-ink); }
.ots-app .ots-scorecard__stats .is-correct strong { color: var(--ots-success); }
.ots-app .ots-scorecard__stats .is-wrong strong { color: var(--ots-danger); }
.ots-app .ots-review__head { flex-wrap: wrap; gap: 10px; }
.ots-app .ots-review__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ots-app .ots-review__list { list-style: none; margin: 12px 0 0; padding: 0; }
.ots-app .ots-rq { padding: 16px 20px; border-top: 1px solid var(--ots-line); }
.ots-app .ots-rq[hidden] { display: none; }
.ots-app .ots-rq__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ots-app .ots-rq__img img { max-width: 100%; height: auto; border-radius: 8px; }
.ots-app .ots-rq__text { margin-bottom: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.ots-app .ots-rq__text p { margin: 0 0 .5em; }
.ots-app .ots-rq__opts { display: grid; gap: 6px; }
.ots-app .ots-rq__opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border: 1px solid var(--ots-line); border-radius: 8px; }
.ots-app .ots-rq__opt.is-right { border-color: #86efac; background: var(--ots-success-bg); }
.ots-app .ots-rq__opt.is-wrong { border-color: #fca5a5; background: var(--ots-danger-bg); }
.ots-app .ots-rq__opt.is-mine { border-color: #a5b4fc; background: #eef2ff; }
.ots-app .ots-rq__key { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1px solid #94a3b8; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; background: #fff; }
.ots-app .ots-rq__otext { flex: 1; overflow-wrap: anywhere; }
.ots-app .ots-rq__otext p { margin: 0; }
.ots-app .ots-rq__tag { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e0e7ff; color: #3730a3; white-space: nowrap; }
.ots-app .ots-rq__tag--right { background: #bbf7d0; color: #14532d; }
.ots-app .ots-rq__exp { margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; }
.ots-app .ots-rq__exp p { margin: 4px 0 0; }

@media (max-width: 900px) {
	.ots-app .ots-tdetail__grid { grid-template-columns: 1fr; }
	.ots-app .ots-tdetail__side { position: static; order: -1; }
	.ots-app .ots-tdetail__hero { flex-direction: column; align-items: stretch; }
	.ots-app .ots-tdetail__thumb { flex-basis: auto; }
	.ots-app .ots-scorecard { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.ots-app--tests, .ots-app--result { padding: 10px; }
	.ots-app .ots-tdetail__title { font-size: 1.3rem; }
	.ots-app .ots-search { max-width: none; }
}

/* ======================= Test Series ======================= */
.ots-app { --ots-unlock: #0b2a6b; --ots-unlock-h: #081f52; }
.ots-app .ots-btn--unlock { background: var(--ots-unlock); color: #fff; }
.ots-app .ots-btn--warning { background: var(--ots-warning); color: #fff; }
.ots-app .ots-text-success { color: var(--ots-success); }
.ots-app .ots-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 650; }
.ots-app .ots-pill--free { background: #e2f5ec; color: #2b8a5f; }
.ots-app--series { background: transparent; }
.ots-app .ots-series-list { display: flex; flex-direction: column; gap: 36px; }
.ots-app .ots-srow__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ots-app .ots-srow__title { font-size: 1.7rem; line-height: 1.2; font-weight: 750; margin: 0 0 4px; letter-spacing: -.01em; }
.ots-app .ots-srow__title a { color: var(--ots-ink); }
.ots-app .ots-srow__head p { margin: 0; }
.ots-app .ots-srow__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ots-app .ots-srow__scroller { position: relative; }
.ots-app .ots-srow__track {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 285px); gap: 14px;
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 4px 2px 10px;
	scrollbar-width: thin;
}
.ots-app .ots-srow__track > li { scroll-snap-align: start; }
.ots-app .ots-srow__arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; min-height: 0;
	background: #0ea5e9; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .2);
}
.ots-app .ots-srow__arrow--prev { left: -12px; }
.ots-app .ots-srow__arrow--next { right: -12px; }
.ots-app .ots-mcard {
	display: flex; flex-direction: column; gap: 12px; min-height: 180px;
	padding: 22px 24px; background: #fff; border: 1px solid var(--ots-line); border-radius: 12px;
}
.ots-app .ots-mcard__title { font-size: 1rem; font-weight: 650; line-height: 1.35; margin: 0; }
.ots-app .ots-mcard__title a { color: var(--ots-ink); }
.ots-app .ots-mcard__meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ots-ink-2); font-size: .92rem; }
.ots-app .ots-mcard__meta li { display: inline-flex; align-items: center; gap: 5px; }
.ots-app .ots-mcard__score { margin: 0; font-size: .82rem; color: var(--ots-success); font-weight: 650; }
.ots-app .ots-mcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ots-app .ots-mcard .ots-btn--sm { min-height: 40px; padding: 8px 18px; font-size: .92rem; }
.ots-app .ots-sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.ots-app .ots-unlock { scroll-margin-top: 24px; }
.ots-app .ots-unlock__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ots-app .ots-unlock__price { font-size: 2rem; font-weight: 800; margin: 0; color: var(--ots-ink); }
.ots-app .ots-unlock__row p { margin: 0; }
.ots-app .ots-unlock__lead { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 650; color: var(--ots-success); }
@media (max-width: 640px) {
	.ots-app .ots-srow__title { font-size: 1.3rem; }
	.ots-app .ots-srow__track { grid-auto-columns: 78%; }
	.ots-app .ots-srow__arrow { display: none; }
}
/* Let series rows shrink to the screen so the track scrolls inside itself. */
.ots-app .ots-srow, .ots-app .ots-srow__scroller { min-width: 0; max-width: 100%; }
.ots-app .ots-srow__track { max-width: 100%; }
/* Keep visually-hidden labels inside the scrolling track (they are absolutely positioned). */
.ots-app .ots-srow__track, .ots-app .ots-mcard, .ots-app .ots-sgrid { position: relative; }

/* ---------- Phase 5: purchase & My Tests ---------- */
.ots-app .ots-buy { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.ots-app .ots-buy__meta { font-size: .82rem; margin: 0; }
.ots-app .ots-buy__test { margin: 0; padding: 6px 10px; border-radius: 8px; background: #fff7ed; color: #9a3412; border: 1px dashed #fdba74; font-size: .8rem; }
.ots-app .ots-buy__status { padding: 10px 12px; border-radius: 8px; font-size: .88rem; background: var(--ots-info-bg); color: #1e3a8a; }
.ots-app .ots-buy__status.is-error { background: var(--ots-danger-bg); color: var(--ots-danger); }
.ots-app .ots-buy__status.is-success { background: var(--ots-success-bg); color: var(--ots-success); }
.ots-app .ots-btn[data-ots-buy][aria-busy="true"] { opacity: .75; cursor: progress; }
.ots-app .ots-unlock__cta { min-width: 0; }
.ots-app .ots-mytests { display: grid; gap: 14px; }
.ots-app .ots-mytest { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.ots-app .ots-mytest__main { min-width: 0; flex: 1 1 320px; }
.ots-app .ots-mytest__title { margin: 4px 0 8px; font-size: 1.08rem; line-height: 1.35; }
.ots-app .ots-mytest__title a { color: var(--ots-ink); text-decoration: none; }
.ots-app .ots-mytest__title a:hover { color: var(--ots-brand); }
.ots-app .ots-mytest__meta { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--ots-muted); align-items: center; }
.ots-app .ots-mytest__progress { display: flex; flex-direction: column; gap: 4px; max-width: 360px; font-size: .85rem; }
.ots-app .ots-mytest p { margin: 0; }
@media (max-width: 600px) {
	.ots-app .ots-mytest__cta, .ots-app .ots-mytest__cta .ots-btn { width: 100%; }
	.ots-app .ots-buy { min-width: 0; width: 100%; }
}

/* ---------- 0.5.1: Unlock popup & guidance ---------- */
.ots-app .ots-btn, .ots-app a.ots-btn:hover, .ots-app a.ots-btn:focus, .ots-app a.ots-btn:visited { text-decoration: none !important; }
.ots-app .ots-btn--unlock:visited { color: #fff; }
.ots-app .ots-btn--outline { background: transparent; color: var(--ots-unlock); border: 1.5px solid var(--ots-unlock); }
.ots-app .ots-btn--outline:hover { background: #eef2ff; }
.ots-app .ots-unlock__guest { font-size: .88rem; color: var(--ots-muted); margin: 0 0 8px !important; }
.ots-app .ots-unlock__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ots-app .ots-start .ots-btn--outline { margin-top: 8px; }
@keyframes ots-flash { 0% { box-shadow: 0 0 0 0 rgba(11, 42, 107, .55); } 70% { box-shadow: 0 0 0 14px rgba(11, 42, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 42, 107, 0); } }
.ots-app .ots-unlock.is-flash { animation: ots-flash 1s ease-out 2; border-color: var(--ots-unlock); }

.ots-dialog { border: 0; padding: 0; border-radius: 16px; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(15, 23, 42, .3); color: var(--ots-ink, #0f172a); font-family: inherit; }
.ots-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.ots-dialog__box { position: relative; padding: 28px 24px 22px; text-align: center; }
.ots-dialog__close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: #64748b; cursor: pointer; border-radius: 50%; }
.ots-dialog__close:hover { background: #f1f5f9; }
.ots-dialog__icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e0e7ff; color: var(--ots-unlock, #0b2a6b); }
.ots-dialog__title { font-size: 1.25rem; margin: 0 0 4px; line-height: 1.3; }
.ots-dialog__lead { margin: 0 0 6px; font-weight: 600; color: #334155; }
.ots-dialog__hi { margin: 0 0 12px; font-size: .9rem; color: #475569; }
.ots-dialog__steps { text-align: left; margin: 0 0 16px; padding: 12px 14px 12px 34px; background: #f8fafc; border-radius: 10px; font-size: .92rem; line-height: 1.5; }
.ots-dialog__steps li { margin: 4px 0; }
.ots-dialog__actions { display: grid; gap: 8px; }
.ots-dialog__note { font-size: .8rem; margin: 12px 0 0; }

/* Charts (shared by admin and front end) */
.ots-chart, .ots-hchart { margin: 0; }
.ots-chart__title { font-weight: 600; font-size: 14px; margin: 0 0 8px; color: #0f172a; }
.ots-chart__svg { width: 100%; height: auto; display: block; overflow: visible; }
.ots-chart__grid { stroke: #e2e8f0; stroke-width: 1; }
.ots-chart__base { stroke: #94a3b8; stroke-width: 1; }
.ots-chart__axis { fill: #64748b; font-size: 13px; font-family: inherit; }
.ots-chart__mark { fill: #2563eb; }
.ots-chart__hit { fill: transparent; }
.ots-chart__bar:hover .ots-chart__mark { fill: #1d4ed8; }
.ots-chart__bar:hover .ots-chart__hit { fill: rgba(37, 99, 235, .06); }
.ots-chart__empty { margin: 0; padding: 40px 0; text-align: center; color: #64748b; font-size: 13px; }
.ots-chart__data { margin-top: 6px; font-size: 12px; color: #475569; }
.ots-chart__data summary { cursor: pointer; }
.ots-chart__data table { border-collapse: collapse; margin-top: 6px; max-height: 240px; display: block; overflow: auto; }
.ots-chart__data td { padding: 2px 10px 2px 0; border-bottom: 1px solid #f1f5f9; }
.ots-hchart__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ots-hchart__row { display: grid; grid-template-columns: minmax(90px, 42%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.ots-hchart__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0f172a; }
.ots-hchart__track { height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.ots-hchart__fill { display: block; height: 100%; background: #2563eb; border-radius: 5px; }
.ots-hchart__value { font-weight: 600; color: #0f172a; min-width: 56px; text-align: right; }
.ots-hchart__value small { font-weight: 400; color: #64748b; }
@media print { .ots-chart__data { display: none; } .ots-chart__mark, .ots-hchart__fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* ---------- Phase 6: leaderboard, performance, print ---------- */
.ots-app .ots-result__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ots-app .ots-board { margin-bottom: 16px; }
.ots-app .ots-board__note { font-size: .8rem; }
.ots-app .ots-board__empty { padding: 0 20px 16px; }
.ots-app .ots-board__list { list-style: none; margin: 0; padding: 0 0 8px; }
.ots-app .ots-board__row { display: grid; grid-template-columns: 44px 1fr auto 70px; gap: 10px; align-items: center; padding: 9px 20px; border-top: 1px solid var(--ots-line); font-size: .93rem; }
.ots-app .ots-board__row.is-me { background: #eff6ff; font-weight: 650; }
.ots-app .ots-board__rank { font-weight: 700; text-align: center; font-size: 1.05rem; }
.ots-app .ots-board__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ots-app .ots-board__name em { font-style: normal; color: var(--ots-brand); }
.ots-app .ots-board__score { font-variant-numeric: tabular-nums; font-weight: 600; }
.ots-app .ots-board__time { text-align: right; font-size: .82rem; }
.ots-app .ots-board__gap { text-align: center; color: var(--ots-muted); padding: 2px 0; border-top: 1px solid var(--ots-line); }
.ots-app .ots-perf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 780px) { .ots-app .ots-perf-grid { grid-template-columns: 1fr; } .ots-app .ots-board__row { grid-template-columns: 36px 1fr auto; } .ots-app .ots-board__time { display: none; } }
.ots-app .ots-tip { margin-bottom: 16px; border-left: 4px solid var(--ots-warning, #b45309); }
.ots-app .ots-tip h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.ots-app .ots-tip__list { margin: 0; padding-left: 20px; }
.ots-app .ots-chart__title { color: var(--ots-ink); }

@media print {
	body * { visibility: hidden; }
	.ots-app--result, .ots-app--result * { visibility: visible; }
	.ots-app--result { position: absolute; left: 0; top: 0; width: 100%; }
	.ots-app--result .ots-btn, .ots-app--result .ots-review__filters, .ots-app--result .ots-result__crumb, .ots-app--result .ots-result__actions { display: none !important; }
	.ots-app--result .ots-card { box-shadow: none; break-inside: avoid; border-color: #cbd5e1; }
	.ots-app--result [data-state] { display: block !important; }
	.ots-app--result .ots-review [hidden] { display: block !important; }
}

/* ---------- 1.1.0: Ebooks ---------- */
.ots-app .ots-filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.ots-app .ots-filterbar input[type="search"] { flex: 1 1 220px; }
.ots-app .ots-filterbar select { flex: 0 0 auto; width: auto; }
.ots-app .ots-ebgrid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ots-app .ots-ebgrid--compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ots-app .ots-ebcard { background: var(--ots-card); border: 1px solid var(--ots-line); border-radius: var(--ots-radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ots-app .ots-ebcard__cover { display: block; aspect-ratio: 3 / 4; background: #eef2ff; overflow: hidden; }
.ots-app .ots-ebcard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ots-app .ots-ebcard__placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ots-unlock); font-weight: 800; letter-spacing: .1em; }
.ots-app .ots-ebcard__placeholder--lg { aspect-ratio: 3 / 4; border-radius: var(--ots-radius); background: #eef2ff; }
.ots-app .ots-ebcard__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ots-app .ots-ebcard__title { font-size: .98rem; line-height: 1.35; margin: 0; }
.ots-app .ots-ebcard__title a { color: var(--ots-ink); text-decoration: none; }
.ots-app .ots-ebcard__meta { margin: 0; font-size: .82rem; color: var(--ots-muted); min-height: 1em; }
.ots-app .ots-ebcard__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ots-app .ots-ebcard__price { font-size: 1.05rem; color: var(--ots-ink); }
.ots-app .ots-ebdetail__grid { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: 24px; margin-bottom: 16px; align-items: start; }
.ots-app .ots-ebdetail__cover img { width: 100%; height: auto; border-radius: var(--ots-radius); box-shadow: 0 8px 24px rgba(15, 23, 42, .15); display: block; }
.ots-app .ots-ebdetail__box { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ots-app .ots-ebdetail__box p { margin: 0; }
.ots-app .ots-ebdetail__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ots-app .ots-ebdetail__box .ots-buy { width: 100%; max-width: 420px; }
.ots-app .ots-ebdetail__note { font-size: .8rem; }
.ots-app .ots-ebdetail__series { margin-top: 12px; font-size: .92rem; }
.ots-app .ots-ebdetail__series ul { margin: 4px 0 0; padding-left: 18px; }
.ots-app [data-ots-ebook-download][aria-busy="true"] { opacity: .7; cursor: progress; }
@media (max-width: 640px) { .ots-app .ots-ebdetail__grid { grid-template-columns: 1fr; } .ots-app .ots-ebdetail__cover { max-width: 200px; } .ots-app .ots-ebdetail__actions .ots-btn { width: 100%; } }
.ots-app .ots-inseries { margin-bottom: 16px; }
.ots-app .ots-inseries h2 { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.ots-app .ots-inseries__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ots-app .ots-inseries__list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--ots-line); }
.ots-app .ots-inseries__list li:first-child { border-top: 0; }
.ots-app .ots-dash__subhead { margin: 24px 0 12px; }
.ots-app--reader { max-width: none; }
.ots-app .ots-reader { background: #e2e8f0; border-radius: var(--ots-radius); overflow: hidden; }
.ots-app .ots-reader__bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #0f172a; color: #fff; }
.ots-app .ots-reader__bar .ots-btn--ghost { background: #1e293b; color: #fff; border-color: #334155; }
.ots-app .ots-reader__title { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ots-app .ots-reader__pages { font-size: .85rem; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.ots-app .ots-reader__zoom { display: inline-flex; gap: 4px; }
.ots-app .ots-reader__status { padding: 12px; margin: 0; text-align: center; }
.ots-app .ots-reader__status[hidden] { display: none; }
.ots-app .ots-reader__pagesbox { padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow-x: auto; }
.ots-app .ots-reader__page { width: 100%; user-select: none; -webkit-user-select: none; }
.ots-app .ots-reader__page canvas { display: block; max-width: none; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .15); }
@media print { .ots-app--reader { display: none !important; } }

.ots-app .ots-ebcard__foot .ots-pill:not(.ots-pill--free), .ots-app .ots-inseries .ots-pill:not(.ots-pill--free) { background: #f1f5f9; color: #475569; }

/* ---------- 1.2.0: visitor Buy Now (quick checkout) ---------- */
.ots-app .ots-buy__login { margin: 0; font-size: .88rem; }
.ots-app .ots-quick .ots-dialog__box { text-align: left; padding-top: 22px; }
.ots-app .ots-quick__step { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ots-muted); }
.ots-app .ots-quick .ots-dialog__title { font-size: 1.12rem; padding-right: 28px; }
.ots-app .ots-quick__price { margin: 0 0 12px; font-size: 1.4rem; font-weight: 800; color: var(--ots-ink); }
.ots-app .ots-quick .ots-field { margin-bottom: 10px; }
.ots-app .ots-quick__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ots-app .ots-quick__error { margin: 4px 0 10px; }
.ots-app .ots-quick__error[hidden], .ots-app .ots-quick [hidden] { display: none !important; }
.ots-app .ots-quick__switch { margin: 10px 0 0; text-align: center; font-size: .9rem; }
.ots-app .ots-quick__safe { margin: 8px 0 0; font-size: .78rem; text-align: center; }
.ots-app .ots-linkbtn { background: none; border: 0; padding: 0; color: var(--ots-brand); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; }
.ots-app .ots-quick [aria-busy="true"] { opacity: .75; cursor: progress; }
.ots-app .ots-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100000; max-width: min(92vw, 480px); box-shadow: 0 8px 24px rgba(15, 23, 42, .2); }
.ots-app .ots-dialog__actions [hidden] { display: none !important; }

/* ==========================================================================
   Home page [ots_home]
   ========================================================================== */
.ots-app--home { --ots-navy: #0b1f4d; --ots-navy-2: #12307a; --ots-saffron: #f59e0b; --ots-saffron-2: #f97316; background: transparent; }
.ots-app .ots-home { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; }
.ots-app .ots-home__section { margin: 56px 0 0; }
.ots-app .ots-home__section--tint { background: linear-gradient(180deg, #f5f8ff, #fff); border: 1px solid #e6ecfb; border-radius: 24px; padding: 32px 24px; }
.ots-app .ots-home__head { text-align: center; margin: 0 auto 24px; max-width: 680px; }
.ots-app .ots-home__head h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.2; font-weight: 800; margin: 0 0 6px; color: var(--ots-ink); letter-spacing: -.02em; }
.ots-app .ots-home__head p { color: var(--ots-muted); margin: 0; font-size: 1rem; }
.ots-app .ots-home__more { text-align: center; margin: 20px 0 0; }
.ots-app .ots-home__more a { font-weight: 700; }

/* Buttons */
.ots-app .ots-home__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 1rem; line-height: 1.2; border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; text-decoration: none !important; }
.ots-app .ots-home__btn:hover { transform: translateY(-1px); }
.ots-app .ots-home__btn--primary { background: linear-gradient(90deg, var(--ots-saffron), var(--ots-saffron-2)); color: #1f1300; box-shadow: 0 8px 22px rgba(249, 115, 22, .35); }
.ots-app .ots-home__btn--primary:hover { color: #1f1300; box-shadow: 0 10px 26px rgba(249, 115, 22, .45); }
.ots-app .ots-home__btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06); }
.ots-app .ots-home__btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.ots-app .ots-home__btn--navy { background: var(--ots-navy); color: #fff; min-height: 44px; padding: 10px 18px; font-size: .95rem; }
.ots-app .ots-home__btn--navy:hover { background: var(--ots-navy-2); color: #fff; }
.ots-app .ots-home__btn--whatsapp { background: #128c4a; color: #fff; }
.ots-app .ots-home__btn--whatsapp:hover { background: #0f7a40; color: #fff; }

/* Hero */
.ots-app .ots-home__hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; margin-top: 16px; padding: 56px 48px; border-radius: 28px; color: #fff;
	background: radial-gradient(900px 400px at 85% -10%, rgba(245, 158, 11, .28), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(59, 130, 246, .35), transparent 60%), linear-gradient(135deg, var(--ots-navy), #0a2a6e 55%, #1e40af); }
.ots-app .ots-home__hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.ots-app .ots-home__hero-text, .ots-app .ots-home__hero-art { position: relative; z-index: 1; min-width: 0; }
.ots-app .ots-home__badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font-size: .85rem; font-weight: 600; color: #fde68a; }
.ots-app .ots-home__title { font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; color: #fff; }
.ots-app .ots-home__subtitle { font-size: clamp(1rem, 1.6vw, 1.15rem); color: #dbe5ff; margin: 0 0 24px; max-width: 560px; }
.ots-app .ots-home__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.ots-app .ots-home__trust { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; }
.ots-app .ots-home__trust li { display: flex; flex-direction: column; min-width: 112px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.ots-app .ots-home__trust strong { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.2; }
.ots-app .ots-home__trust span { font-size: .8rem; color: #c7d4f5; }
.ots-app .ots-home__art { display: block; width: 100%; height: auto; max-width: 520px; margin-left: auto; }

/* Exams */
.ots-app .ots-home__exams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ots-app .ots-home__exam { display: flex; align-items: center; gap: 14px; padding: 16px; height: 100%; background: #fff; border: 1px solid var(--ots-line); border-radius: 18px; color: var(--ots-ink); transition: border-color .15s, box-shadow .15s, transform .15s; text-decoration: none !important; }
.ots-app .ots-home__exam:hover { border-color: #bfd0fb; box-shadow: 0 12px 28px rgba(15, 35, 95, .1); transform: translateY(-2px); }
.ots-app .ots-home__exam-logo { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; font-size: .9rem; letter-spacing: .02em; }
.ots-app .ots-home__exam-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }
.ots-app .ots-tone--blue { background: #dbeafe; color: #1e40af; }
.ots-app .ots-tone--saffron { background: #ffedd5; color: #9a3412; }
.ots-app .ots-tone--green { background: #dcfce7; color: #166534; }
.ots-app .ots-tone--purple { background: #f3e8ff; color: #6b21a8; }
.ots-app .ots-tone--red { background: #fee2e2; color: #991b1b; }
.ots-app .ots-tone--teal { background: #ccfbf1; color: #115e59; }
.ots-app .ots-home__exam-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ots-app .ots-home__exam-text strong { font-size: 1.05rem; font-weight: 700; }
.ots-app .ots-home__exam-text span { font-size: .85rem; color: var(--ots-muted); }
.ots-app .ots-home__arrow { color: var(--ots-brand); font-size: 1.2rem; font-weight: 700; }

/* Series cards */
.ots-app .ots-home__series { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.ots-app .ots-home__scard { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; background: #fff; border: 1px solid var(--ots-line); border-radius: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: box-shadow .15s, transform .15s; overflow: hidden; }
.ots-app .ots-home__scard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--ots-navy-2), #3b82f6, var(--ots-saffron)); }
.ots-app .ots-home__scard:hover { box-shadow: 0 16px 36px rgba(15, 35, 95, .12); transform: translateY(-2px); }
.ots-app .ots-home__scard-top { display: flex; flex-wrap: wrap; gap: 6px; }
.ots-app .ots-home__chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: .75rem; font-weight: 700; }
.ots-app .ots-home__chip--free { background: #dcfce7; color: #166534; }
.ots-app .ots-home__scard h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; font-weight: 800; }
.ots-app .ots-home__scard h3 a { color: var(--ots-ink); }
.ots-app .ots-home__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: .88rem; color: var(--ots-ink-2); }
.ots-app .ots-home__facts li { display: flex; align-items: center; gap: 6px; }
.ots-app .ots-home__facts .ots-icon { color: var(--ots-brand); }
.ots-app .ots-home__scard-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--ots-line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ots-app .ots-home__price { display: flex; flex-direction: column; line-height: 1.15; }
.ots-app .ots-home__price strong { font-size: 1.6rem; font-weight: 800; color: var(--ots-ink); }
.ots-app .ots-home__price span { font-size: .78rem; color: var(--ots-muted); }

/* Features */
.ots-app .ots-home__features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ots-app .ots-home__feature { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px; background: #fff; border: 1px solid var(--ots-line); }
.ots-app .ots-home__feature-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e0e9ff, #fff3dc); color: var(--ots-navy-2); margin-bottom: 6px; }
.ots-app .ots-home__feature strong { font-size: 1.02rem; }
.ots-app .ots-home__feature > span:last-child { color: var(--ots-muted); font-size: .92rem; }

/* Free tests */
.ots-app .ots-home__free { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ots-app .ots-home__free a { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "badge title" "badge meta" "badge go"; column-gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ots-line); background: #fff; color: var(--ots-ink); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.ots-app .ots-home__free a:hover { border-color: #86efac; box-shadow: 0 10px 24px rgba(21, 128, 61, .1); }
.ots-app .ots-home__free-badge { grid-area: badge; align-self: start; padding: 4px 8px; border-radius: 8px; background: var(--ots-success-bg); color: var(--ots-success); font-size: .72rem; font-weight: 800; letter-spacing: .05em; }
.ots-app .ots-home__free strong { grid-area: title; font-size: .98rem; }
.ots-app .ots-home__free .ots-muted { grid-area: meta; }
.ots-app .ots-home__free-go { grid-area: go; color: var(--ots-success); font-weight: 700; font-size: .88rem; margin-top: 4px; }

/* Steps */
.ots-app .ots-home__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
.ots-app .ots-home__steps li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 24px 22px 22px; border-radius: 18px; background: #fff; border: 1px solid var(--ots-line); }
.ots-app .ots-home__steps li > span { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ots-navy); color: #fff; font-weight: 800; margin-bottom: 8px; }
.ots-app .ots-home__steps em { font-style: normal; color: var(--ots-muted); font-size: .92rem; }

/* Final CTA */
.ots-app .ots-home__cta { margin: 56px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px 40px; border-radius: 24px; color: #fff; background: radial-gradient(600px 300px at 100% 0, rgba(245, 158, 11, .3), transparent 60%), linear-gradient(135deg, var(--ots-navy), #1e40af); }
.ots-app .ots-home__cta h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 800; }
.ots-app .ots-home__cta p { color: #dbe5ff; margin: 0; }

@media (max-width: 900px) {
	.ots-app .ots-home__hero { grid-template-columns: 1fr; padding: 36px 24px 28px; }
	.ots-app .ots-home__art { max-width: 420px; margin: 0 auto; }
	.ots-app .ots-home__features { grid-template-columns: 1fr 1fr; }
	.ots-app .ots-home__steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.ots-app .ots-home { padding: 0 10px 32px; }
	.ots-app .ots-home__hero { border-radius: 20px; padding: 28px 18px 20px; }
	.ots-app .ots-home__ctas .ots-home__btn { flex: 1 1 100%; }
	.ots-app .ots-home__trust li { min-width: 0; flex: 1 1 40%; }
	.ots-app .ots-home__features { grid-template-columns: 1fr; }
	.ots-app .ots-home__section { margin-top: 40px; }
	.ots-app .ots-home__section--tint { padding: 24px 14px; }
	.ots-app .ots-home__cta { padding: 28px 20px; }
	.ots-app .ots-home__series { grid-template-columns: 1fr; }
	.ots-app .ots-ebgrid.ots-home__ebooks { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.ots-app .ots-home__btn, .ots-app .ots-home__exam, .ots-app .ots-home__scard { transition: none; transform: none !important; }
}
/* Centre short rows (2 exams / 2 series / 3 ebooks look balanced). */
.ots-app .ots-home__exams { grid-template-columns: repeat(auto-fit, minmax(270px, 340px)); justify-content: center; }
.ots-app .ots-home__series { grid-template-columns: repeat(auto-fit, minmax(300px, 380px)); justify-content: center; }
.ots-app .ots-ebgrid.ots-home__ebooks { grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); justify-content: center; }
.ots-app .ots-home__free { grid-template-columns: repeat(auto-fit, minmax(260px, 300px)); justify-content: center; }
@media (max-width: 560px) {
	.ots-app .ots-home__exams, .ots-app .ots-home__series, .ots-app .ots-home__free { grid-template-columns: 1fr; }
	.ots-app .ots-ebgrid.ots-home__ebooks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
	.ots-app .ots-home__features { grid-template-columns: 1fr 1fr; gap: 10px; }
	.ots-app .ots-home__feature { padding: 14px; }
	.ots-app .ots-home__feature > span:last-child { font-size: .84rem; }
}

/* ==========================================================================
   Exam page [ots_exam]
   ========================================================================== */
.ots-app--exam .ots-exam-page { max-width: 1200px; margin: 0 auto; padding: 0 12px 32px; }
.ots-app .ots-exam-hero { display: flex; align-items: center; gap: 22px; margin: 16px 0 28px; padding: 32px 36px; border-radius: 24px; color: #fff;
	background: radial-gradient(600px 300px at 100% 0, rgba(245, 158, 11, .3), transparent 60%), linear-gradient(135deg, #0b1f4d, #0a2a6e 55%, #1e40af); }
.ots-app .ots-exam-hero__logo { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 22px; background: #fff; color: #1e40af; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; font-size: 1.1rem; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.ots-app .ots-exam-hero__logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.ots-app .ots-exam-hero__text { min-width: 0; }
.ots-app .ots-exam-hero h1 { margin: 0 0 6px; color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.ots-app .ots-exam-hero p { color: #dbe5ff; margin: 0 0 14px; }
.ots-app .ots-exam-hero__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ots-app .ots-exam-hero__stats li { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-size: .88rem; color: #e0e8ff; }
.ots-app .ots-exam-hero__stats strong { color: #fff; }
.ots-app .ots-exam-hero__stats li.is-free { background: #dcfce7; color: #166534; border-color: #dcfce7; }
.ots-app .ots-exam-hero__stats li.is-free strong { color: #166534; }
.ots-app .ots-exam-ebooks { margin-top: 36px; }
@media (max-width: 600px) {
	.ots-app .ots-exam-hero { flex-direction: column; align-items: flex-start; padding: 24px 20px; border-radius: 18px; }
	.ots-app .ots-exam-hero__logo { width: 64px; height: 64px; flex-basis: 64px; }
}

/* Tests page: choose your exam */
.ots-app .ots-exams__grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); justify-content: stretch; margin-top: 8px; }
.ots-app .ots-exams__tile { min-height: 96px; }
.ots-app .ots-exams__free { font-style: normal; font-size: .78rem; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 999px; padding: 1px 8px; margin-top: 4px; align-self: flex-start; }
.ots-app .ots-exams__all { text-align: center; margin: 22px 0 0; }
.ots-app .ots-exam-back { margin: 8px 0 0; }
.ots-app .ots-exam-back a { font-weight: 600; }
.ots-app .ots-exam-solo { margin-top: 32px; }
.ots-app .ots-exam-solo .ots-h2 { margin-bottom: 14px; }
@media (max-width: 560px) { .ots-app .ots-exams__grid { grid-template-columns: 1fr; } }
