/* Arbitrage Guides pages on the design system: page frame, forum lists, posts, search results, sidebar, account pages. */

/* ---- Page frame: the content lines up with the header and footer (1200 px, 24 px sides) ---- */
.ag-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 28px 24px 56px;
}
.ag-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 32px;
	align-items: start;
}
@media (max-width: 1000px) {
	.ag-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
	.ag-page { padding: 20px 16px 48px; }
}
.ag-main { min-width: 0; }

/* ---- Breadcrumbs (BreadcrumbList microdata kept from the old pages) ---- */
.ag-crumbs { margin: 0 0 10px; }
.ag-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--text-muted);
	font-size: 13px;
}
.ag-crumbs li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ag-crumbs li + li::before { content: '/'; color: var(--text-dim); }
.ag-crumbs a { color: var(--text-muted); text-decoration: none; }
.ag-crumbs a:hover { color: var(--text); text-decoration: underline; }
.ag-crumbs [aria-current] { color: var(--text); overflow-wrap: anywhere; }

/* ---- Page head: the title and the forum search ---- */
.ag-page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin: 0 0 24px;
}
.ag-page-head h1 {
	margin: 0;
	overflow-wrap: anywhere;
	min-width: min(100%, 320px);
	flex: 1 1 420px;
}
.ag-search {
	position: relative;
	flex: 0 1 300px;
	min-width: 220px;
	margin: 0;
}
.ag-search .input { padding-left: 38px; }
.ag-search-ic {
	position: absolute;
	left: 12px;
	top: 50%;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	color: var(--text-dim);
	pointer-events: none;
}
@media (max-width: 640px) {
	.ag-search { flex: 1 1 100%; }
}

/* ---- Flash messages ---- */
.ag-flash {
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-left-width: 4px;
	border-radius: var(--shape-sm);
	background: var(--surface-container);
	color: var(--text);
	font-size: 14px;
	line-height: 1.5;
}
.ag-flash.is-ok { border-left-color: var(--status-ok-text); }
.ag-flash.is-err { border-left-color: var(--status-err-text); }
.ag-flash strong { margin-right: 4px; }
.ag-flash ul { margin: 6px 0 0; padding-left: 20px; }

/* ---- Small labels on rows and posts ---- */
.ag-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border: 1px solid var(--border-strong);
	border-radius: var(--shape-pill);
	color: var(--text-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	line-height: 18px;
	white-space: nowrap;
}
.ag-badge.is-wait { border-color: var(--status-warn); color: var(--status-warn-text); }
.ag-ic { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---- Forum index: the forums ---- */
.ag-forums {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--border);
	border-radius: var(--shape-md);
	background: var(--surface);
	overflow: hidden;
}
.ag-forum {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px 24px;
	padding: 18px 20px;
	border-top: 1px solid var(--border);
}
.ag-forum:first-child { border-top: 0; }
.ag-forum h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; font-weight: 700; letter-spacing: -0.1px; }
.ag-forum h2 a { color: var(--text); text-decoration: none; }
.ag-forum h2 a:hover { color: var(--primary); text-decoration: underline; }
.ag-forum-desc { margin: 0 0 8px; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.ag-last {
	margin: 0;
	color: var(--text-muted);
	font-size: 13px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.ag-last a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ag-stats { display: flex; gap: 20px; align-self: center; }
.ag-stat { min-width: 64px; text-align: center; }
.ag-stat-n { display: block; color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ag-stat-l { display: block; color: var(--text-muted); font-size: 12px; }
@media (max-width: 640px) {
	.ag-forum { grid-template-columns: minmax(0, 1fr); }
	.ag-stats { align-self: start; gap: 16px; }
	.ag-stat { min-width: 0; text-align: left; display: flex; align-items: baseline; gap: 6px; }
	.ag-stat-n { display: inline; font-size: 14px; }
	.ag-stat-l { display: inline; font-size: 13px; }
}

/* ---- A forum: its topics ---- */
.ag-topics-head,
.ag-topic {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 84px 200px;
	gap: 6px 20px;
	align-items: center;
}
.ag-topics-head {
	padding: 0 20px 8px;
	color: var(--text-dim);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.ag-topics {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--border);
	border-radius: var(--shape-md);
	background: var(--surface);
	overflow: hidden;
}
.ag-topic { padding: 14px 20px; border-top: 1px solid var(--border); }
.ag-topic:first-child { border-top: 0; }
.ag-topic.is-pinned { background: var(--surface-container-low); }
.ag-topic h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; letter-spacing: -0.1px; overflow-wrap: anywhere; }
.ag-topic h2 a { color: var(--text); text-decoration: none; }
.ag-topic h2 a:hover { color: var(--primary); text-decoration: underline; }
.ag-topic-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.ag-topic-by { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.ag-topic-by a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.ag-topic-replies { color: var(--text); font-size: 14px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ag-topic-last { color: var(--text-muted); font-size: 13px; line-height: 1.45; }
/* The column names, for screen readers on wide screens (the visible head row is decorative) and on screen on a phone. */
.ag-cell-l {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.ag-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 48px 24px;
	border: 1px dashed var(--border-strong);
	border-radius: var(--shape-md);
	color: var(--text-muted);
	text-align: center;
}
.ag-empty-icon { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }
.ag-empty-title { margin: 0 0 6px; color: var(--text); font-size: 16px; font-weight: 700; }
.ag-empty-msg { max-width: 360px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
@media (max-width: 760px) {
	.ag-topics-head { display: none; }
	.ag-topic { grid-template-columns: minmax(0, 1fr); gap: 4px; }
	.ag-topic-replies { text-align: left; font-size: 13px; font-weight: 400; color: var(--text-muted); }
	.ag-cell-l { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* ---- New topic / reply forms ---- */
.ag-compose { margin: 24px 0 0; }
.ag-compose-bar { display: flex; justify-content: flex-end; margin: 16px 0 0; }
.ag-compose h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; letter-spacing: -0.1px; }
/* The new topic form opens without a jump: a grid row from 0fr to 1fr. */
.ag-disclosure { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-medium, 240ms) var(--ease-emphasized, ease); }
.ag-disclosure.is-open { grid-template-rows: 1fr; }
.ag-disclosure-in { min-height: 0; overflow: hidden; }
.ag-disclosure.is-open .ag-disclosure-in { overflow: visible; }
@media (prefers-reduced-motion: reduce) { .ag-disclosure { transition: none; } }
.ag-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.ag-field label { color: var(--text); font-size: 14px; font-weight: 700; }
.ag-compose-actions { display: flex; justify-content: flex-end; margin: 14px 0 0; }
.ag-note {
	margin: 24px 0 0;
	padding: 12px 16px;
	border-radius: var(--shape-sm);
	background: var(--surface-container);
	color: var(--text-muted);
	font-size: 14px;
}
.ag-note a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.btn[aria-busy="true"] { opacity: 0.75; }
.ag-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--text-muted); font-size: 14px; }

/* ---- A topic: its posts ---- */
.ag-posts { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.ag-post {
	border: 1px solid var(--border);
	border-radius: var(--shape-md);
	background: var(--surface);
	scroll-margin-top: calc(var(--header-h, 64px) + 16px);
}
.ag-post-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--border);
}
.ag-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--surface-container-high);
	color: var(--text-muted);
	font-size: 16px;
	font-weight: 700;
}
.ag-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ag-author { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.ag-author-name { color: var(--text); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
a.ag-author-name { text-decoration: none; }
a.ag-author-name:hover { text-decoration: underline; }
.ag-author-meta { color: var(--text-muted); font-size: 12px; }
.ag-post-when { color: var(--text-muted); font-size: 13px; }
.ag-post-body { padding: 16px 20px; color: var(--text); font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.ag-post-body > :first-child { margin-top: 0; }
.ag-post-body > :last-child { margin-bottom: 0; }
.ag-post-body p { margin: 0 0 12px; }
.ag-post-body a { color: var(--primary); text-decoration: underline; }
.ag-post-body blockquote {
	margin: 0 0 12px;
	padding: 8px 14px;
	border-left: 3px solid var(--border-strong);
	background: var(--surface-container-low);
	color: var(--text-muted);
	border-radius: 0 var(--shape-xs) var(--shape-xs) 0;
}
.ag-post-body ul, .ag-post-body ol { margin: 0 0 12px; padding-left: 24px; }
.ag-post-body pre {
	margin: 0 0 12px;
	padding: 10px 12px;
	overflow-x: auto;
	border-radius: var(--shape-xs);
	background: var(--surface-container);
	font-size: 14px;
	white-space: pre;
}
.ag-post-body img { max-width: 100%; height: auto; }
.ag-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.ag-attachments a {
	display: block;
	width: 88px;
	height: 88px;
	border: 1px solid var(--border);
	border-radius: var(--shape-sm);
	overflow: hidden;
	background: var(--surface-container);
}
.ag-attachments img { width: 100%; height: 100%; object-fit: cover; }
.ag-post-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 16px; }
@media (max-width: 480px) {
	.ag-post-head, .ag-post-body { padding-left: 16px; padding-right: 16px; }
	.ag-attachments, .ag-post-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---- Image viewer (attachments): a native dialog ---- */
dialog.ag-viewer {
	max-width: min(1100px, 96vw);
	max-height: 94vh;
	padding: 0;
	border: 0;
	border-radius: var(--shape-md);
	background: var(--surface);
	color: var(--text);
	overflow: hidden;
}
dialog.ag-viewer::backdrop { background: rgba(0, 0, 0, 0.75); }
.ag-viewer-img { display: block; max-width: min(1100px, 96vw); max-height: calc(94vh - 56px); margin: 0 auto; object-fit: contain; }
.ag-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
.ag-viewer-count { color: var(--text-muted); font-size: 13px; }
.ag-viewer-nav { display: flex; gap: 8px; }

/* ---- Search results ---- */
.ag-results { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: ag-result; }
.ag-result {
	padding: 14px 20px;
	border: 1px solid var(--border);
	border-radius: var(--shape-md);
	background: var(--surface);
}
.ag-result-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.ag-result-title a { color: var(--text); }
.ag-result-meta { margin: 0 0 8px; color: var(--text-muted); font-size: 13px; }
.ag-result-meta a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.ag-results mark, .ag-result mark {
	background: color-mix(in srgb, var(--primary) 28%, transparent);
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
}
.ag-result-text { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }

/* ---- Sidebar: recent posts and the advertisement tiles ---- */
.ag-aside { display: flex; flex-direction: column; gap: 20px; }
.ag-box {
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: var(--shape-md);
	background: var(--surface);
}
.ag-box h2 { margin: 0 0 12px; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.ag-recent { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ag-recent a { color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ag-recent-meta { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.ag-recent-text {
	display: -webkit-box;
	margin: 4px 0 0;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: var(--text-muted);
	font-size: 13px;
	line-height: 1.45;
}
@media (max-width: 1000px) {
	.ag-aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* Promotion tiles: brand sprite and colours; dark text on the green button (white was 2.0:1). */
.ag-ads { display: grid; gap: 10px; }
.ag-ad { display: block; overflow: hidden; border-radius: 7px; text-decoration: none; }
.ag-ad:hover .ag-ad-label { text-decoration: underline; }
.ag-ad-head { display: block; height: 32px; border-bottom: 1px solid #222; }
/* The sprite (1270 x 32) is drawn for a 209 px tile: the logo keeps that width, so a wider tile (a phone) cannot crop it. */
.ag-ad-img { display: block; width: 209px; max-width: 100%; height: 32px; margin: 0 auto; background-image: url("../img/forum/forum-ads.png"); background-repeat: no-repeat; background-size: 607% auto; }
.ag-ad-body { display: block; padding: 0 10px 10px; color: #fff; text-align: center; text-shadow: 1px 1px 3px #000; font-weight: 700; }
.ag-ad-label { display: block; font-size: 15px; line-height: 28px; }
.ag-ad-btn {
	display: block;
	padding: 3px 0 5px;
	border-radius: 3px;
	background: #70c989;
	box-shadow: 1px 1px 2px #000;
	color: #0b1f12;
	font-size: 11px;
	text-shadow: none;
	text-transform: uppercase;
}
.ag-ad-1 .ag-ad-head { background: #323232; } .ag-ad-1 .ag-ad-img { background-position: -15px 0; } .ag-ad-1 .ag-ad-body { background: #5a5a5a; }
.ag-ad-2 .ag-ad-head { background: #0c304c; } .ag-ad-2 .ag-ad-img { background-position: 50.5% 0; } .ag-ad-2 .ag-ad-body { background: #0a4d81; }
.ag-ad-3 .ag-ad-head { background: #3e3d39; } .ag-ad-3 .ag-ad-img { background-position: 26% 0; } .ag-ad-3 .ag-ad-body { background: #5a5a5a; }
.ag-ad-4 .ag-ad-head { background: #0d1522; } .ag-ad-4 .ag-ad-img { background-position: 74.1% 0; } .ag-ad-4 .ag-ad-body { background: #293243; }
.ag-ad-5 .ag-ad-head { background: linear-gradient(90deg, #fdc30e 0, #f7961c); } .ag-ad-5 .ag-ad-img { background-position: 98.3% 0; } .ag-ad-5 .ag-ad-body { background: #0d1522; }
.ag-ads-note { color: var(--text-dim); font-size: 11px; text-align: center; }

/* The free course banner (730 x 90). */
.ag-banner { display: block; max-width: 730px; margin: 28px auto 0; }
.ag-banner img { display: block; width: 100%; height: auto; border-radius: var(--shape-sm); }

/* Wide member HTML (a pasted table, a long link) scrolls inside its post, never the page. */
.ag-post-body table { display: block; max-width: 100%; overflow-x: auto; }

/* ---- Account pages: sign-in, registration, password, the member's account, a public profile (stage 3) ---- */
.ag-card {
	padding: clamp(20px, 4vw, 32px);
	border: 1px solid var(--border);
	border-radius: var(--shape-lg);
	background: var(--surface-container-low);
}
.ag-card h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; letter-spacing: -0.1px; }
.ag-card h3 { margin: 24px 0 12px; font-size: 16px; font-weight: 700; }
.ag-auth { max-width: 460px; margin: 0 auto; }
.ag-auth h1 { margin: 0 0 16px; font-size: 26px; font-weight: 700; line-height: 1.25; text-align: center; }
.ag-auth-sub { margin: -6px 0 20px; color: var(--text-muted); font-size: 14px; line-height: 1.5; text-align: center; }
.ag-auth-alt { margin: 16px 0 0; color: var(--text-muted); font-size: 14px; text-align: center; }
.ag-auth-alt a, .ag-form-note a, .ag-row-meta a { color: var(--primary-soft, var(--primary)); font-weight: 700; text-decoration: underline; }
.ag-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.ag-form .ag-field { margin: 0; }
/* 16 px in every field: a phone does not zoom into a focused one. */
.ag-form .input, .ag-picture .input { width: 100%; font-size: 16px; }
.ag-form textarea.input { min-height: 120px; resize: vertical; }
.ag-auth .ag-form > .btn { width: 100%; justify-content: center; }
.ag-field-err { color: var(--status-err-text); font-size: 13px; font-weight: 600; line-height: 1.4; }
.ag-field-help { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.ag-form-note { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
/* A value the member cannot change (the account address) reads as text, still a field for password managers. */
.ag-form .input[readonly] { padding-left: 0; border-color: transparent; background: none; box-shadow: none; color: var(--text-muted); }
/* The file field's own button in the site's secondary style. */
.ag-picture input[type="file"] { padding: 6px; font-size: 14px; }
.ag-picture input[type="file"]::file-selector-button {
	margin-right: 10px;
	padding: 6px 14px;
	border: 1px solid var(--border-strong);
	border-radius: var(--shape-pill);
	background: var(--surface-container-high);
	color: var(--text);
	font: 600 13px var(--font-body);
	cursor: pointer;
}
.ag-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ag-form-foot { display: flex; justify-content: flex-end; }
.ag-captcha { align-items: center; min-height: 65px; }
@media (max-width: 600px) { .ag-form-row { grid-template-columns: 1fr; } }

/* The member's account: the section list beside (wide) or above (narrow) the sections. */
.ag-account { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; max-width: 960px; margin: 0 auto; }
.ag-account-nav { position: sticky; top: calc(var(--header-h, 64px) + 16px); display: flex; flex-direction: column; gap: 2px; }
.ag-account-nav a { padding: 8px 12px; border-radius: var(--shape-sm); color: var(--text-muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.ag-account-nav a:hover { background: var(--surface-container); color: var(--text); }
.ag-account-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ag-account-main h1 { margin: 0; font-size: 28px; font-weight: 700; }
.ag-account-main > .ag-flash { margin: 0; }
.ag-account-main .ag-card { scroll-margin-top: calc(var(--header-h, 64px) + 16px); }
@media (max-width: 800px) {
	.ag-account { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.ag-account-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
	.ag-account-nav a { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--shape-pill); font-size: 13px; }
}
.ag-avatar-lg { width: 80px; height: 80px; flex-basis: 80px; font-size: 30px; }
.ag-picture { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 0; }
.ag-picture .ag-field { margin: 0; }
@media (max-width: 600px) { .ag-picture { grid-template-columns: 80px minmax(0, 1fr); } .ag-picture .btn { grid-column: 1 / -1; justify-self: end; } }
.ag-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ag-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.ag-row:first-child { border-top: 0; padding-top: 0; }
.ag-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.ag-row-title { color: var(--text); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
a.ag-row-title { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.ag-row-meta { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.ag-row-amount { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; color: var(--text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ag-row-amount small { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.ag-access-active { border-color: var(--status-ok-text); color: var(--status-ok-text); }
.ag-access-expired { color: var(--text-muted); }
.ag-access-suspended { border-color: var(--status-warn); color: var(--status-warn-text); }

/* A member's public profile. */
.ag-member { display: flex; flex-direction: column; gap: 24px; max-width: 640px; margin: 0 auto; }
.ag-member-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.ag-member-card h1 { flex: 1 1 200px; margin: 0; font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.ag-member-stats { display: flex; gap: 20px; margin: 0; }
.ag-member-stats div { min-width: 64px; text-align: center; }
.ag-member-stats dt { color: var(--text-muted); font-size: 12px; }
.ag-member-stats dd { margin: 0; color: var(--text); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ag-member-stats div { display: flex; flex-direction: column-reverse; }

/* After registration. */
.ag-welcome { text-align: center; }
.ag-welcome-icon { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--status-ok-text); }
.ag-welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0 0; }

/* ---- Guides and blog (stage 4): article, rating, comments, lists, pages (the article text: ag-prose.css) ---- */
.ag-article { margin: 0; }
.ag-article-dates { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.ag-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 20px 0 0; }
.ag-stars { display: inline-flex; gap: 2px; }
.ag-star { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--shape-sm); background: none; color: var(--border-strong); cursor: pointer; }
.ag-star svg { width: 24px; height: 24px; fill: currentColor; }
.ag-star.is-on { color: var(--primary); }
@media (hover: hover) { .ag-stars:not([aria-busy="true"]):hover .ag-star { color: var(--primary); } .ag-stars:not([aria-busy="true"]) .ag-star:hover ~ .ag-star { color: var(--border-strong); } }
.ag-star:disabled { cursor: default; }
.ag-star:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ag-rating-text, .ag-rating-note { margin: 0; color: var(--text-muted); font-size: 14px; }
.ag-rating-note { flex-basis: 100%; color: var(--status-ok-text); font-weight: 600; }
.ag-comments { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h, 64px) + 16px); }
.ag-comments h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.ag-comment-list { display: flex; flex-direction: column; gap: 16px; margin: 0 0 20px; padding: 0; list-style: none; }
.ag-comment { display: flex; gap: 12px; }
.ag-comment-main { min-width: 0; flex: 1; }
.ag-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 4px; color: var(--text-muted); font-size: 13px; }
.ag-comment-head strong { color: var(--text); font-size: 14px; }
.ag-comment-text { color: var(--text); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ag-comment-form { margin-top: 8px; }
.ag-comments .ag-note { margin-top: 8px; }
.ag-prevnext { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.ag-prevnext a { max-width: 48%; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.ag-prevnext a:hover { text-decoration: underline; }
.ag-prevnext-next { margin-left: auto; text-align: right; }
.ag-links { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ag-links a { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; line-height: 1.4; }
.ag-links a:hover { text-decoration: underline; }
.ag-links-meta { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.ag-aside-stack { display: flex; flex-direction: column; gap: 20px; }
.ag-hp { position: absolute; left: -5000px; }
.ag-box .ag-form .btn { width: 100%; justify-content: center; }
.ag-posts-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ag-post-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--border); }
.ag-post-card:first-child { border-top: 0; padding-top: 0; }
.ag-post-card-img img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: var(--shape-md, 12px); background: var(--surface-container); }
.ag-post-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.ag-post-card h2 a { color: var(--text); text-decoration: none; }
.ag-post-card h2 a:hover { text-decoration: underline; }
.ag-post-card-meta { margin: 0 0 6px; color: var(--text-muted); font-size: 13px; }
.ag-post-card-meta a { color: var(--primary-soft, var(--primary)); }
.ag-post-card-text { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
@media (max-width: 480px) { .ag-post-card { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } .ag-post-card-img img { width: 72px; height: 72px; } }
.ag-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 24px 0 0; }
.ag-pager :is(a, span) { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--shape-pill); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.ag-pager a:hover { border-color: var(--border-strong); background: var(--surface-container); }
.ag-pager [aria-current="page"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.ag-notfound { max-width: 640px; margin: 0 auto; text-align: center; }
.ag-notfound h1 { margin: 24px 0 8px; font-size: 32px; font-weight: 700; }
.ag-notfound-sub { margin: 0 0 28px; color: var(--text-muted); font-size: 18px; }
.ag-notfound-courses { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.ag-notfound-courses a { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 201px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.ag-notfound-courses img { border: 1px solid var(--border); border-radius: var(--shape-sm); }
.ag-notfound-courses a:hover img { box-shadow: 0 0 6px var(--primary); }
