/* ==========================================================================
   Aurora — Forum CMS default theme
   ========================================================================== */
:root {
  --primary: #6366f1;
  --accent: #8b5cf6;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, transparent);
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #f1f3f9;
  --bg-hover: #f4f5fb;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5e7ef;
  --border-strong: #d6d9e4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .15);
  --header-h: 64px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1020;
  --bg-elev: #121a2e;
  --bg-soft: #18213a;
  --bg-hover: #1a2440;
  --text: #e6e9f2;
  --text-2: #c3c9d9;
  --muted: #8b94ab;
  --border: #222c47;
  --border-strong: #2d3a5c;
  --primary-soft: color-mix(in srgb, var(--primary) 22%, transparent);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
[data-radius="sharp"] { --radius: 6px; --radius-sm: 4px; }
[data-radius="pill"] { --radius: 20px; --radius-sm: 14px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }
[x-cloak] { display: none !important; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.main { padding: 24px 0 56px; min-height: calc(100vh - 260px); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg-elev) 85%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent); }
.brand img { height: 36px; width: auto; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav > .nav-item { position: relative; }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; background: none; border: 0; font-family: inherit; }
.nav-link i { color: var(--muted); font-size: 13px; }
.nav-link:hover, .nav-link.active { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-link.active i { color: var(--primary); }
.dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .15s ease-out; }
.dropdown.right { left: auto; right: 0; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.dropdown a i, .dropdown button i { width: 18px; color: var(--muted); text-align: center; }
.dropdown .divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-header { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.header-search { flex: 1; max-width: 380px; margin-left: auto; position: relative; }
.header-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font: inherit; font-size: 14px; transition: .15s; }
.header-search input:focus { outline: none; border-color: var(--primary); background: var(--bg-elev); box-shadow: 0 0 0 4px var(--primary-soft); }
.header-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 70; }
.search-suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.search-suggest a:hover { background: var(--bg-soft); text-decoration: none; }
.search-suggest .label { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 10px 2px; letter-spacing: .05em; font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); background: none; border: 0; cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.icon-btn .count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg-elev); }
.avatar-btn { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 12px; background: none; border: 0; cursor: pointer; color: var(--text); font: inherit; }
.avatar-btn:hover { background: var(--bg-soft); }
.menu-toggle { display: none; }

.notif-panel { width: 360px; max-height: 480px; overflow: auto; padding: 0; }
.notif-item { display: flex !important; gap: 12px; padding: 12px 14px !important; border-radius: 0 !important; border-bottom: 1px solid var(--border); align-items: flex-start !important; }
.notif-item.unread { background: var(--primary-soft); }
.notif-icon { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg-soft); color: var(--primary) !important; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: transform .05s, filter .15s, background .15s; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-light { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.on { color: var(--primary); background: var(--primary-soft); border-color: transparent; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-control, .form-select { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form-help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 5px; }
.form-check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.form-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.input-icon { position: relative; } .input-icon i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); } .input-icon .form-control { padding-left: 38px; }
.hp-field { position: absolute !important; left: -9999px !important; }

/* ---------- Cards & layout ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 15px; }
.card + .card { margin-top: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 16px; list-style: none; padding: 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs li + li::before { content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 9px; margin-right: 6px; opacity: .6; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: color-mix(in srgb, var(--success) 12%, var(--bg-elev)); color: color-mix(in srgb, var(--success) 75%, var(--text)); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-danger { background: color-mix(in srgb, var(--danger) 10%, var(--bg-elev)); color: color-mix(in srgb, var(--danger) 80%, var(--text)); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--warning) 12%, var(--bg-elev)); color: color-mix(in srgb, var(--warning) 60%, var(--text)); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--primary-soft); color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.7; background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border-color: transparent; }
.badge-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); border-color: transparent; }
.badge-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: color-mix(in srgb, var(--warning) 80%, var(--text)); border-color: transparent; }
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border); }
.tag:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.group-badge { display: inline-flex; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .02em; }

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-soft); }
.avatar-xs { width: 24px; height: 24px; } .avatar-sm { width: 32px; height: 32px; } .avatar-md { width: 42px; height: 42px; } .avatar-lg { width: 64px; height: 64px; } .avatar-xl { width: 112px; height: 112px; }
.avatar-wrap { position: relative; display: inline-flex; }
.online-dot { position: absolute; bottom: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--success); border: 2px solid var(--bg-elev); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); padding: 34px 32px; margin-bottom: 24px; color: #fff; background: radial-gradient(800px 300px at 0% 0%, color-mix(in srgb, var(--accent) 80%, transparent), transparent 60%), linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #0f172a)); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h1 { font-size: 1.9rem; margin-bottom: 8px; position: relative; }
.hero p { margin: 0 0 18px; opacity: .9; max-width: 640px; position: relative; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.hero .btn-light { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero .btn-white { background: #fff; color: var(--primary); }
.hero-stats { display: flex; gap: 28px; margin-top: 22px; position: relative; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.35rem; }
.hero-stats span { font-size: 13px; opacity: .8; }

/* ---------- Categories ---------- */
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; gap: 10px; }
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head h2 a { color: inherit; }
.cat-list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cat-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 140px 250px; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--border); transition: background .15s; }
.cat-row:first-child { border-top: 0; }
.cat-row:hover { background: var(--bg-hover); }
.cat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent); overflow: hidden; }
.cat-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-title { font-weight: 700; font-size: 15.5px; color: var(--text); }
.cat-title:hover { color: var(--primary); text-decoration: none; }
.cat-desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.subcats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.subcats a { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.subcats a i { font-size: 11px; color: var(--muted); }
.cat-stats { display: flex; gap: 18px; justify-content: flex-end; text-align: center; }
.cat-stats b { display: block; font-size: 15px; } .cat-stats span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cat-last { display: flex; gap: 10px; align-items: center; min-width: 0; font-size: 13px; }
.cat-last a.t { color: var(--text); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-card { padding: 18px; display: flex; gap: 14px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c, var(--primary)) 40%, var(--border)); text-decoration: none; }

/* ---------- Thread list ---------- */
.thread-list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.thread-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 190px; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); transition: background .15s; }
.thread-row:first-child { border-top: 0; }
.thread-row:hover { background: var(--bg-hover); }
.thread-row.pinned { background: color-mix(in srgb, var(--primary) 4%, var(--bg-elev)); }
.thread-title { font-weight: 650; font-size: 15px; color: var(--text); display: inline; }
.thread-title:hover { color: var(--primary); text-decoration: none; }
.thread-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; align-items: center; }
.thread-meta a { color: var(--muted); }
.thread-flags { display: inline-flex; gap: 5px; margin-right: 6px; vertical-align: 1px; }
.thread-flags i { font-size: 11px; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; }
.flag-pin { color: var(--primary); background: var(--primary-soft); }
.flag-lock { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.flag-feat { color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); }
.flag-solved { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.thread-stats { display: flex; gap: 16px; justify-content: flex-end; font-size: 13px; color: var(--muted); }
.thread-stats b { color: var(--text); font-weight: 700; }
.thread-last { display: flex; gap: 9px; align-items: center; font-size: 12.5px; color: var(--muted); justify-content: flex-end; text-align: right; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.tabs a { padding: 6px 13px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { font-size: 38px; margin-bottom: 12px; opacity: .45; display: block; }

/* ---------- Thread view ---------- */
.thread-header { margin-bottom: 18px; }
.thread-header h1 { font-size: 1.65rem; margin-bottom: 8px; word-break: break-word; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post { display: grid; grid-template-columns: 180px minmax(0, 1fr); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow-sm); scroll-margin-top: calc(var(--header-h) + 16px); }
.post:target { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.post.best { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
.post.unapproved { opacity: .75; border-style: dashed; }
.post-author { padding: 20px 14px; text-align: center; border-right: 1px solid var(--border); background: linear-gradient(to bottom, var(--bg-soft), transparent 70%); border-radius: var(--radius) 0 0 var(--radius); }
.post-author .name { font-weight: 700; display: block; margin-top: 8px; color: var(--text); word-break: break-all; }
.post-author .utitle { font-size: 12px; color: var(--muted); }
.post-author .ustats { font-size: 12px; color: var(--muted); margin-top: 10px; display: grid; gap: 2px; }
.post-author .ustats div { display: flex; justify-content: space-between; padding: 0 6px; }
.post-author .ubadges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.post-author .ubadges i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; }
.post-main { min-width: 0; display: flex; flex-direction: column; }
.post-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); gap: 10px; }
.post-head a { color: var(--muted); }
.post-body { padding: 20px; flex: 1; overflow-wrap: anywhere; }
.post-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
.post-foot .left, .post-foot .right { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.best-label { display: inline-flex; gap: 6px; align-items: center; color: var(--success); font-weight: 700; font-size: 12.5px; }
.reply-to { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: inline-flex; gap: 6px; align-items: center; background: var(--bg-soft); padding: 3px 10px; border-radius: 8px; }
.like-btn.on { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.edited { font-size: 12px; color: var(--muted); font-style: italic; padding: 0 20px 6px; }
.attachments { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 14px; }
.attachment { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text); background: var(--bg-soft); }
.attachment img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }

/* Rich content */
.content { font-size: 15.5px; line-height: 1.72; color: var(--text); }
.content > :first-child { margin-top: 0; } .content > :last-child { margin-bottom: 0; }
.content p { margin: 0 0 1em; }
.content img { border-radius: 10px; margin: 6px 0; }
.content blockquote { margin: 0 0 1em; padding: 12px 16px; border-left: 3px solid var(--primary); background: var(--bg-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.content blockquote[data-author]::before { content: attr(data-author) " " var(--said, "wrote:"); display: block; font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.content pre, .content .ql-syntax { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }
.content code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; }
.content pre code { background: none; padding: 0; }
.content a.mention { background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.content iframe, .video-embed iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 12px; }
.content ul, .content ol { padding-left: 1.4em; }
.content h2, .content h3 { margin-top: 1.2em; }
.content table { border-collapse: collapse; width: 100%; } .content td, .content th { border: 1px solid var(--border); padding: 6px 10px; }
.video-embed { margin-bottom: 16px; }

/* Editor */
.editor-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); }
.editor-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 8px; background: var(--bg-soft); }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 15px; }
.editor-wrap .ql-editor { min-height: 180px; color: var(--text); line-height: 1.65; }
.editor-wrap .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.editor-wrap .ql-snow .ql-stroke { stroke: var(--text-2); } .editor-wrap .ql-snow .ql-fill { fill: var(--text-2); } .editor-wrap .ql-snow .ql-picker { color: var(--text-2); }
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-stroke, .editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-fill, .editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--primary); }
.editor-wrap .ql-snow .ql-tooltip { background: var(--bg-elev); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-lg); border-radius: 10px; z-index: 5; }
.editor-wrap .ql-snow .ql-tooltip input[type=text] { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.editor-wrap .ql-emoji { font-size: 16px; line-height: 1; }
.editor-wrap .ql-editor pre.ql-syntax { background: #0f172a; color: #e2e8f0; }
.emoji-picker { position: absolute; z-index: 30; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; }
.emoji-picker button { width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; font-size: 20px; cursor: pointer; }
.emoji-picker button:hover { background: var(--bg-soft); }
.mention-list { position: absolute; z-index: 30; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; }
.mention-list button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 10px; border: 0; background: none; color: var(--text); border-radius: 7px; cursor: pointer; font: inherit; font-size: 14px; }
.mention-list button.active, .mention-list button:hover { background: var(--bg-soft); }
.upload-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; font-size: 13px; }
.upload-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.reply-box { margin-top: 20px; }
.quick-reply-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 20px 0 0; list-style: none; padding: 0; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); background: var(--bg-elev); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .active span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled span { opacity: .45; }

/* ---------- Sidebar widgets ---------- */
.widget .card-header { padding: 12px 16px; }
.widget .card-body { padding: 14px 16px; }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 13.5px; }
.widget-list li:first-child { border-top: 0; padding-top: 0; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid div { background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; }
.stat-grid b { display: block; font-size: 18px; }
.stat-grid span { font-size: 12px; color: var(--muted); }
.online-avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Members & profile ---------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.member-card { padding: 20px; text-align: center; transition: transform .15s, box-shadow .15s; }
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.member-card .name { font-weight: 700; display: block; margin-top: 10px; color: var(--text); }
.member-card .stats { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.member-card .stats b { color: var(--text); display: block; font-size: 15px; }
.profile-cover { height: 220px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(135deg, var(--primary), var(--accent)); background-size: cover; background-position: center; }
.profile-head { display: flex; gap: 20px; align-items: flex-end; padding: 0 24px 20px; margin-top: -56px; flex-wrap: wrap; }
.profile-head .avatar-xl { border: 5px solid var(--bg-elev); box-shadow: var(--shadow); }
.profile-head h1 { margin: 0; font-size: 1.5rem; }
.profile-stats { display: flex; gap: 0; border-top: 1px solid var(--border); }
.profile-stats div { flex: 1; text-align: center; padding: 14px 8px; border-left: 1px solid var(--border); }
.profile-stats div:first-child { border-left: 0; }
.profile-stats b { display: block; font-size: 18px; }
.profile-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.badge-tile { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.badge-tile i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; }
/* badge pictures (1.1.0) */
img.badge-img { width: 1.15em; height: 1.15em; object-fit: contain; vertical-align: -0.2em; display: inline-block; }
.post-author .ubadges img.badge-img { width: 24px; height: 24px; }
.badge-tile img.badge-img { width: 40px; height: 40px; flex: none; }
.leader-row { display: grid; grid-template-columns: 48px 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.leader-row:first-child { border-top: 0; }
.rank { font-weight: 800; font-size: 18px; color: var(--muted); text-align: center; }
.rank-1 { color: #f59e0b; } .rank-2 { color: #94a3b8; } .rank-3 { color: #b45309; }

/* ---------- Account ---------- */
.account-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-nav { padding: 8px; position: sticky; top: calc(var(--header-h) + 20px); }
.account-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.account-nav a i { width: 18px; text-align: center; color: var(--muted); }
.account-nav a:hover { background: var(--bg-soft); text-decoration: none; color: var(--text); }
.account-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.account-nav a.active i { color: var(--primary); }
.account-nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 12px 4px; font-weight: 700; }

/* ---------- Messages ---------- */
.conv-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); color: var(--text); }
.conv-row:first-child { border-top: 0; }
.conv-row:hover { background: var(--bg-hover); text-decoration: none; }
.conv-row.unread { background: var(--primary-soft); }
.conv-row.unread .subject { font-weight: 800; }
.msg { display: flex; gap: 12px; margin-bottom: 16px; max-width: 80%; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg-bubble { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; min-width: 0; }
.msg.me .msg-bubble { background: var(--primary-soft); border-color: transparent; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 36px 0 24px; font-size: 14px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--text); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--muted); } .footer-grid a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }
/* Footer (1.1.0): brand · quick links · contact */
.ft-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px; }
.ft-brand { display: flex; align-items: center; gap: 12px; color: var(--text) !important; text-decoration: none !important; margin-bottom: 12px; }
.ft-logo { max-height: 56px; max-width: 220px; }
.ft-mark { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); flex: none; }
.ft-name { display: block; font-size: 26px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; color: var(--text); }
.ft-tagline { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.ft-text { margin: 0; max-width: 520px; line-height: 1.6; color: var(--text-2, var(--muted)); }
.ft-h { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin: 0 0 14px; }
.ft-h::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ft-links, .ft-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ft-links li { display: flex; align-items: center; gap: 10px; }
.ft-links li::before { content: ""; width: 7px; height: 7px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.ft-links a, .ft-contact a, .ft-contact span { color: var(--text-2, var(--muted)); }
.ft-links a:hover, .ft-contact a:hover, .ft-bottom-links a:hover { color: var(--primary); }
.ft-contact li { display: flex; align-items: center; gap: 10px; }
.ft-contact i { width: 16px; text-align: center; color: var(--muted); }
.ft-social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ft-social a { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; background: var(--text); color: var(--bg-elev) !important; font-size: 14px; transition: transform .15s, background .15s; }
.ft-social a:hover { background: var(--primary); transform: translateY(-2px); }
.ft-bottom { align-items: center; }
.ft-bottom .copyright a { color: var(--primary); font-weight: 600; }
.ft-bottom-links { display: flex; flex-wrap: wrap; gap: 18px; }
.ft-bottom-links a { color: var(--text-2, var(--muted)); }
@media (max-width: 900px) { .ft-grid { grid-template-columns: 1fr 1fr; } .ft-about { grid-column: 1 / -1; } }
@media (max-width: 560px) { .ft-grid { grid-template-columns: 1fr; } .ft-bottom { flex-direction: column; align-items: flex-start; } }
.social { display: flex; gap: 8px; margin-top: 14px; }
.social a { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-soft); color: var(--text-2); }
.social a:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 20px auto; }
.auth-card { padding: 32px; }
.auth-card h1 { font-size: 1.5rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: -4px 0 24px; }
.auth-icon { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--bg-elev); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow-lg); animation: pop .15s ease-out; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; bottom: 20px; right: 20px; z-index: 100; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s ease-out; }
.back-top { position: fixed; bottom: 22px; right: 22px; z-index: 40; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cat-row { grid-template-columns: 52px minmax(0, 1fr) 200px; }
  .cat-row .cat-stats { display: none; }
  .thread-row { grid-template-columns: 44px minmax(0, 1fr) 170px; }
  .thread-row .thread-stats { display: none; }
  .nav-link span { display: none; }
  .nav-link { padding: 8px 10px; }
}
@media (max-width: 900px) {
  .layout, .account-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .account-nav { position: static; }
  .menu-toggle { display: grid; }
  .site-header .nav { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--bg-elev); flex-direction: column; align-items: stretch; padding: 12px; gap: 4px; overflow-y: auto; transform: translateX(-100%); transition: transform .25s ease; z-index: 55; }
  .site-header .nav.open { transform: none; }
  .nav-link span { display: inline; }
  .nav-link { padding: 12px 14px; font-size: 15px; }
  .dropdown.nav-dd { position: static; box-shadow: none; border: 0; padding-left: 20px; animation: none; }
  .header-search { display: none; }
  .header-search.mobile-open { display: block; position: absolute; left: 12px; right: 12px; top: calc(var(--header-h) + 8px); max-width: none; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .container { padding: 0 14px; }
  .main { padding-top: 16px; }
  .cat-row { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; }
  .cat-row .cat-last { display: none; }
  .cat-icon { width: 42px; height: 42px; font-size: 17px; }
  .thread-row { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 14px; }
  .thread-row .thread-last { display: none; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-author { display: flex; gap: 12px; align-items: center; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius) var(--radius) 0 0; }
  .post-author .avatar-lg { width: 40px; height: 40px; }
  .post-author .name { margin-top: 0; }
  .post-author .ustats, .post-author .ubadges, .post-author .level { display: none; }
  .post-body { padding: 16px 14px; }
  .hero { padding: 24px 20px; } .hero h1 { font-size: 1.45rem; }
  .profile-head { padding: 0 16px 16px; }
  .msg { max-width: 100%; }
  .notif-panel { width: calc(100vw - 24px); }
  .brand .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Registration form (1.1.2): live username check, show/hide password, date of birth */
.field-hint { font-size: 12px; font-weight: 600; color: var(--warning); }
.field-msg { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.field-msg.ok { color: var(--success); }
.field-msg.bad { color: var(--danger); }
.uname-field .form-control { padding-right: 40px; }
.uname-field.is-ok .form-control { border-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); font-weight: 600; }
.uname-field.is-bad .form-control { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); }
.uname-state { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }
.uname-field.is-ok .uname-state i { color: var(--success); }
.uname-field.is-bad .uname-state i { color: var(--danger); }
.uname-state i.fa-spin { color: var(--warning); }
.pw-field .form-control { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.pw-eye:hover { background: var(--bg-soft); color: var(--text); }
.input-icon.pw-field > .pw-eye i, .input-icon.uname-field > .uname-state i { position: static; transform: none; }
.dob-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }

/* 1.1.9: extra block in a category row (e.g. an advertisement from a plugin) */
.cat-row.has-aside { grid-template-columns: 52px minmax(0, 1fr) auto 140px 250px; }
.cat-aside { display: flex; align-items: center; justify-content: center; min-width: 0; }
@media (max-width: 1100px) { .cat-row.has-aside { grid-template-columns: 52px minmax(0, 1fr) auto 200px; } }
@media (max-width: 680px) {
  .cat-row.has-aside { grid-template-columns: 44px minmax(0, 1fr); }
  .cat-row.has-aside .cat-aside { grid-column: 2 / -1; justify-content: flex-start; }
}
