:root {
  --brand: #b0161e;
  --brand-d: #8c0f16;
  --brand-soft: #fbefef;
  --ink: #222;
  --text: #333;
  --muted: #757575;
  --line: #e5e5e5;
  --line-d: #cfcfcf;
  --bg: #fff;
  --soft: #f7f7f7;
  --paper: #fcfaf6;
  --link: #1a5aa8;
  --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --text-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: Arial, 'Helvetica Neue', Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
.container { max-width: 1130px; margin: 0 auto; padding: 0 15px; }

/* ---------- Header ---------- */
.site-header { background: #fff; }
.topline { border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.topline-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 32px; }
.topline-links { display: flex; gap: 16px; }
.topline-links a:hover { color: var(--brand); }
.masthead { display: flex; align-items: center; gap: 20px; padding: 14px 15px; }
.logo { display: flex; flex-direction: column; flex-shrink: 0; line-height: 1; }
.logo:hover { color: inherit; }
.logo-text { font: 900 32px/1 var(--serif); letter-spacing: -.5px; color: var(--ink); }
.logo-text b { color: var(--brand); font-weight: 900; }
.logo-sub { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: .2px; }
.search { flex: 1; max-width: 360px; margin-left: auto; display: flex; border: 1px solid var(--line-d); background: #fff; }
.search:focus-within { border-color: #888; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 10px; font: 14px var(--sans); outline: none; }
.search button { border: 0; border-left: 1px solid var(--line); background: var(--soft); padding: 0 12px; cursor: pointer; color: #555; display: grid; place-items: center; }
.search button:hover { color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 3px; font: 700 14px var(--sans);
  border: 1px solid var(--line-d); background: #fff; color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-d); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--brand); }

.mainnav { border-top: 1px solid var(--line); border-bottom: 3px solid var(--ink); background: #fff; position: sticky; top: 0; z-index: 50; }
.nav-in { display: flex; align-items: stretch; }
.nav-links { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a, .nav-more-btn { color: var(--ink); padding: 10px 12px; font: 700 14px var(--sans); white-space: nowrap; position: relative; }
.nav-links a:first-child { padding-left: 0; }
.nav-links a:hover, .nav-more-btn:hover { color: var(--brand); }
.nav-links a.active, .nav-more-btn.active { color: var(--brand); }
.nav-links a.active::after, .nav-more-btn.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 3px; background: var(--brand); }
.nav-links a:first-child.active::after { left: 0; }
.nav-more { position: relative; flex-shrink: 0; display: flex; border-left: 1px solid var(--line); margin: 6px 0; }
.nav-more-btn { border: 0; background: none; cursor: pointer; margin: -6px 0; }
.nav-more-btn .caret { font-size: 14px; display: inline-block; transition: transform .15s; }
.nav-more.open .caret { transform: rotate(180deg); }
.nav-menu { display: none; position: absolute; left: 0; top: calc(100% + 9px); min-width: 210px; background: #fff; border: 1px solid var(--line-d); border-top: 3px solid var(--brand); box-shadow: 0 8px 22px rgba(0, 0, 0, .12); z-index: 60; }
.nav-more.open .nav-menu { display: block; }
.nav-menu a { display: block; padding: 9px 14px; color: var(--ink); font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--line); }
.nav-menu a:last-child { border-bottom: 0; }
.nav-menu a:hover, .nav-menu a.active { color: var(--brand); background: var(--soft); }

.gradebar { border-bottom: 1px solid var(--line); }
.gradebar .container { display: flex; overflow-x: auto; scrollbar-width: none; align-items: center; padding-top: 7px; padding-bottom: 7px; }
.gradebar .container::-webkit-scrollbar { display: none; }
.gradebar .label { font-size: 12.5px; color: var(--muted); margin-right: 10px; white-space: nowrap; }
.gradebar .chip { padding: 0 10px; border-left: 1px solid var(--line); line-height: 1.2; }
.gradebar .label + .chip { border-left: 0; padding-left: 0; }
.chip { display: inline-block; white-space: nowrap; font-size: 13.5px; color: #4a4a4a; }
.chip:hover { color: var(--brand); }
.chip.active { color: var(--brand); font-weight: 700; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; margin: 20px 0 40px; }
.main { min-width: 0; }
.block { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 2px solid var(--ink); padding-top: 9px; margin-bottom: 16px;
}
.block-head h2 { font: 700 18px/1.3 var(--serif); }
.block-head h2 a:hover { color: var(--brand); }
.block-tabs { display: flex; flex-wrap: wrap; }
.block-tabs a { font-size: 13px; padding: 0 8px; color: var(--muted); border-left: 1px solid var(--line); }
.block-tabs a:first-child { border-left: 0; }
.block-tabs a:hover { color: var(--brand); }
.more { display: inline-block; margin-top: 12px; font-size: 13.5px; color: var(--link); }
.more:hover { text-decoration: underline; color: var(--link); }

/* ---------- Thumbnails ---------- */
.thumb {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10; background: #ececec center 30% / cover no-repeat;
}
.thumb .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 clamp(20px, 3.4vw, 38px) var(--serif); color: #c4c4c4;
}
.thumb.has-img .ph { display: none; }
.thumb:hover { opacity: .92; }
.grade-badge { display: none; }

/* ---------- Cards ---------- */
.kicker { color: var(--brand); font-size: 13px; }
.kicker:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 12.5px; color: var(--muted); }
.meta .m-grade { color: var(--brand); font-weight: 700; }
.meta .m-angle { color: var(--muted); }
.meta .m-angle:hover { color: var(--brand); }
.meta .dot::before { content: '|'; margin-right: 8px; color: #ccc; }

.hero { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 24px; }
.lead .thumb { aspect-ratio: 16 / 9; }
.lead h1 { font: 700 26px/1.35 var(--serif); margin: 12px 0 8px; }
.lead h1 a:hover { color: var(--brand); }
.lead p { color: #4a4a4a; margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.hero-side { display: flex; flex-direction: column; }
.hero-side .mini { padding: 12px 0; border-top: 1px solid var(--line); }
.hero-side .mini:first-child { padding-top: 0; border-top: 0; }

.mini { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.mini .thumb { aspect-ratio: 3 / 2; }
.mini .thumb .ph { font-size: 18px; }
.mini h3 { font: 700 14.5px/1.45 var(--serif); margin-bottom: 4px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card h3 { font: 700 16px/1.45 var(--serif); margin: 10px 0 6px; }
.card p {
  font-size: 14px; color: #555; margin: 0 0 6px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.list { margin-top: 4px; }
.item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.list > .item:first-child { border-top: 0; padding-top: 4px; }
.grid + .list > .item:first-child { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.item h3 { font: 700 18px/1.45 var(--serif); margin-bottom: 6px; }
.item .sapo {
  font-size: 14.5px; color: #4a4a4a; margin: 0 0 8px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.angles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.angle-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.angle-card:hover { background: var(--soft); color: inherit; }
.angle-card b { font: 700 14.5px/1.4 var(--serif); color: var(--ink); }
.angle-card:hover b { color: var(--brand); }
.angle-card span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Sidebar ---------- */
.aside { display: flex; flex-direction: column; gap: 26px; }
.widget h3 { font: 700 16px/1.3 var(--serif); border-top: 2px solid var(--ink); padding-top: 9px; margin-bottom: 10px; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; padding-top: 2px; }
.rank li::before { content: counter(r); font: 700 22px/1.1 var(--serif); color: #bdbdbd; }
.rank a { font: 700 14px/1.45 var(--serif); color: var(--ink); }
.rank a:hover { color: var(--brand); }
.rank small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 4px 9px; border: 1px solid var(--line); color: #444; }
.tag:hover { border-color: var(--brand); color: var(--brand); }
.cta { background: var(--soft); padding: 0 14px 14px; border-top: 2px solid var(--brand); }
.cta h3 { border-top: 0; padding-top: 12px; }
.cta p { margin: 0 0 12px; font-size: 14px; color: #4a4a4a; line-height: 1.55; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- Listing page ---------- */
.page-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head h1 { font: 700 28px/1.3 var(--serif); margin: 8px 0 6px; }
.page-head p { margin: 0; color: #555; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--brand); }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 6px; color: #bbb; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 12px; }
.filters .chip { padding: 0 12px; border-left: 1px solid var(--line); line-height: 1.3; }
.filters .chip:first-child { padding-left: 0; border-left: 0; }
.filters.sub { margin-top: 8px; }
.filters.sub .chip { font-size: 13px; color: var(--muted); }
.filters.sub .chip.active { color: var(--brand); }
.load-more { display: block; width: 100%; margin-top: 16px; padding: 10px; border: 1px solid var(--line-d); background: #fff; font: 700 14px var(--sans); color: var(--ink); cursor: pointer; }
.load-more:hover { color: var(--brand); border-color: var(--brand); }
.load-more[hidden] { display: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------- Article ---------- */
.post { margin-bottom: 24px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 10px 0 4px; font-size: 13px; }
.pill { color: var(--muted); padding: 0 10px; border-left: 1px solid var(--line); }
.post-tags .pill:first-child { padding-left: 0; border-left: 0; }
.pill.brand { color: var(--brand); }
.pill.user { color: var(--link); }
.post h1 { font: 700 32px/1.35 var(--serif); margin: 8px 0 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.post-meta b { color: var(--ink); }
.post .lede { font: 700 17px/1.65 var(--sans); color: var(--ink); margin: 16px 0 18px; }
.post-figure { margin: 0 0 22px; }
.post-figure .thumb { aspect-ratio: auto; height: 340px; }
.post-figure .thumb.has-img { background-color: #f2f2f2; }
.post-figure img { width: 100%; max-height: 500px; object-fit: contain; background: #f2f2f2; }
.post-figure figcaption { font-size: 13.5px; color: #555; background: var(--soft); padding: 8px 12px; line-height: 1.5; }
.post-figure figcaption a { color: var(--link); }
.post-body { font: 18px/1.75 var(--text-serif); color: #222; }
.post-body h2 { font: 700 20px/1.4 var(--serif); margin: 28px 0 10px; }
.post-body p { margin: 0 0 16px; }
.post-body ul { margin: 0 0 16px; padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote { margin: 18px 0 20px; padding: 2px 0 2px 18px; border-left: 3px solid var(--line-d); font-style: italic; color: #444; }
.post-body strong { color: #000; }

.questions { margin-top: 28px; background: var(--soft); border-top: 2px solid var(--ink); padding: 14px 18px; }
.questions h3 { font: 700 16px var(--serif); margin-bottom: 8px; }
.questions ol { margin: 0; padding-left: 20px; }
.questions li { margin: 6px 0; }
.refs { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.refs h3 { font-size: 15px; margin-bottom: 8px; }
.refs ol { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.refs li { margin: 4px 0; word-break: break-word; }
.refs a { color: var(--link); }
.refs .note { font-size: 12.5px; color: var(--muted); margin: 0; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.share > span { font-weight: 700; font-size: 14px; margin-right: 4px; }
.share .btn { padding: 6px 12px; font-size: 13px; }
.share .fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.share .x { background: #111; border-color: #111; color: #fff; }
.share .fb:hover, .share .x:hover { opacity: .9; color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field label i { font-style: normal; color: var(--brand); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field input, .field select, .field textarea {
  width: 100%; font: 15px var(--sans); padding: 9px 11px; border-radius: 2px;
  border: 1px solid var(--line-d); background: #fff; color: var(--ink); outline: none;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #777; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.error { color: var(--brand); font-size: 14px; font-weight: 700; }

/* ---------- Sources table ---------- */
.table-wrap { overflow-x: auto; }
table.src { width: 100%; border-collapse: collapse; font-size: 14px; }
table.src th, table.src td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.src th { font-size: 12.5px; color: var(--muted); border-bottom: 2px solid var(--ink); }
table.src img { width: 72px; height: 54px; object-fit: cover; }
table.src a { color: var(--link); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--soft); border-top: 3px solid var(--ink); color: #555; padding: 28px 0 0; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 28px; }
.site-footer h4 { font: 700 14px var(--serif); color: var(--ink); margin-bottom: 10px; }
.site-footer a { display: block; padding: 3px 0; font-size: 13.5px; }
.site-footer a:hover { color: var(--brand); }
.site-footer p { font-size: 13.5px; margin: 10px 0 0; line-height: 1.6; }
.site-footer .logo { display: inline-flex; }
.site-footer .logo-text { font-size: 26px; }
.copyright { border-top: 1px solid var(--line-d); margin-top: 24px; padding-top: 14px; padding-bottom: 18px; font-size: 12.5px; color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #222; color: #fff; padding: 10px 18px; border-radius: 3px; font-size: 14px; transition: .25s; z-index: 100;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Góc vui ---------- */
.fun-note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line-d); padding: 2px 0 2px 10px; margin: 0 0 16px; }
.fun-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fun-feed.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fun-feed.one { grid-template-columns: 1fr; }
.fun-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px; }
.fun-body { max-height: 270px; overflow: hidden; }
.fun-feed.cols3 .fun-body { max-height: 230px; }
.fun-feed.one .fun-body { max-height: 360px; }
.fun-card.open .fun-body { max-height: none; }
.fun-card.clamped .fun-body { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fun-more { align-self: flex-start; margin-top: 4px; border: 0; background: none; padding: 2px 0; font: 700 13px var(--sans); color: var(--link); cursor: pointer; }
.fun-more[hidden] { display: none; }
.t-tiktok .fun-more { color: #25f4ee; }
.fun-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fun-head div { min-width: 0; flex: 1; }
.fun-head b { display: block; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fun-head small { color: var(--muted); font-size: 12px; }
.fun-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: #fff; background: hsl(var(--h) 35% 45%); }
.fun-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border: 1px solid var(--line-d); color: #555; white-space: nowrap; }
.fun-body p { margin: 0 0 8px; font-size: 15px; line-height: 1.55; }
.fun-replies { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 6px; font-size: 13.5px; color: #333; }
.fun-replies b { color: var(--ink); margin-right: 4px; }
.fun-learn { margin: 10px 0 0; font-size: 13px; background: var(--soft); color: #444; border-left: 3px solid var(--brand); padding: 7px 10px; line-height: 1.5; }
.fun-learn b { color: var(--brand); }
.fun-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font-size: 13px; }
.fun-foot .fun-work { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.fun-like { flex-shrink: 0; white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 3px; padding: 3px 10px; cursor: pointer; font: inherit; color: #555; }
.fun-like.on { color: var(--brand); border-color: #e7b5b8; }
.fun-work { color: var(--link); margin-left: auto; }
/* Threads */
.t-threads .fun-badge { border-color: #111; color: #111; }
/* TikTok */
.t-tiktok { background: #151515; color: #eee; border-color: #151515; }
.t-tiktok .fun-head b { color: #fff; }
.t-tiktok .fun-head small, .t-tiktok .fun-sound { color: #aaa; }
.t-tiktok .fun-badge { border-color: #555; color: #ddd; }
.fun-tt-screen { display: grid; gap: 6px; background: #222; border-radius: 4px; padding: 12px; margin-bottom: 10px; }
.fun-tt-scene { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.fun-tt-scene b { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: #fe2c55; color: #fff; font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.t-tiktok .fun-caption { font-weight: 700; }
.fun-sound { font-size: 12.5px; margin: 0; }
.t-tiktok .fun-learn { background: #222; color: #ddd; border-left-color: #fe2c55; }
.t-tiktok .fun-learn b { color: #fe2c55; }
.t-tiktok .fun-like { background: #222; border-color: #333; color: #ddd; }
.t-tiktok .fun-like.on { color: #fe2c55; }
.t-tiktok .fun-work { color: #9fd8ff; }
/* Group chat */
.t-chat .fun-badge { border-color: #0084ff; color: #0067c7; }
.fun-chat { display: flex; flex-direction: column; gap: 6px; background: #f4f5f8; border-radius: 4px; padding: 10px; }
.fun-msg { max-width: 82%; display: flex; flex-direction: column; }
.fun-msg small { font-size: 11px; color: var(--muted); margin: 0 8px 2px; }
.fun-msg span { padding: 7px 11px; border-radius: 14px; font-size: 14px; line-height: 1.4; background: #e4e6eb; color: #111; }
.fun-msg.r { align-self: flex-end; text-align: right; }
.fun-msg.r span { background: #0084ff; color: #fff; text-align: left; }
.fun-sys { align-self: center; font-size: 11.5px; color: var(--muted); text-align: center; padding: 2px 8px; }
/* Review */
.t-review .fun-badge { border-color: #d9a400; color: #8a6400; }
.fun-place { font-weight: 700; font-size: 14px; margin-bottom: 2px; color: var(--ink); }
.fun-stars { color: #f0a500; font-size: 17px; letter-spacing: 2px; margin-bottom: 6px; }
.fun-stars i { color: #ddd; font-style: normal; }
/* Status */
.t-status .fun-badge { border-color: #1b4fb3; color: #1b4fb3; }
/* Truyện cười */
.t-joke .fun-badge { border-color: var(--brand); color: var(--brand); }
.fun-av.joke-av { background: #f3ede1; font-size: 18px; }
.t-joke .fun-head b { white-space: normal; font: 700 15px/1.4 var(--serif); }
.fun-joke p { margin: 0 0 6px; font-size: 15px; line-height: 1.6; }
.fun-joke .fun-line { padding-left: 12px; border-left: 2px solid var(--line-d); }
.fun-here { margin: 26px 0 8px; }
.fun-here h3 { font: 700 18px var(--serif); border-top: 2px solid var(--ink); padding-top: 9px; margin: 0 0 12px; }

/* ---------- Tài khoản ---------- */
.auth-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 36px; }
.auth-area .btn { padding: 7px 14px; font-size: 13.5px; }
.auth-wait { color: var(--muted); padding: 0 8px; }
.auth-user { display: flex; align-items: center; gap: 8px; }
.auth-name { font-weight: 700; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.auth-out { padding: 5px 10px !important; font-size: 13px; }
body.signed-in .cta-auth { display: none; }
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 4px; border-top: 3px solid var(--brand); padding: 20px 24px; }
.modal-card h2 { font: 700 21px var(--serif); margin: 14px 0; }
.modal-x { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--brand); }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-right: 28px; }
.auth-tabs button { border: 0; background: none; padding: 8px 14px 9px; font: 700 14px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.auth-form { gap: 12px; }
.auth-submit { width: 100%; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-link { justify-self: center; border: 0; background: none; color: var(--link); font: 13px var(--sans); cursor: pointer; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-google { width: 100%; gap: 10px; }
.auth-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 12px 0 0; }

/* ---------- Bình luận ---------- */
.comments { margin-top: 28px; }
.comments h3 { font: 700 18px var(--serif); border-top: 2px solid var(--ink); padding-top: 9px; margin: 0 0 14px; }
.comments h3 span { color: var(--muted); font-weight: 400; }
.cmt-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--soft); padding: 12px 14px; }
.cmt-login span { flex: 1; min-width: 200px; font-size: 14.5px; }
.cmt-compose { display: flex; gap: 10px; align-items: flex-start; }
.cmt-input { flex: 1; min-width: 0; }
.cmt-input textarea { width: 100%; font: 15px/1.55 var(--sans); padding: 9px 11px; border: 1px solid var(--line-d); border-radius: 2px; resize: vertical; outline: none; }
.cmt-input textarea:focus { border-color: #777; }
.cmt-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cmt-bar small { color: var(--muted); }
.cmt-list { list-style: none; margin: 16px 0 0; padding: 0; }
.cmt { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: 0; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cmt-head b { font-size: 14.5px; color: var(--ink); }
.cmt-head small { color: var(--muted); font-size: 12.5px; }
.cmt-main p { margin: 4px 0 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.cmt-del { margin-left: auto; border: 0; background: none; color: var(--muted); font: 13px var(--sans); cursor: pointer; text-decoration: underline; }
.cmt-del:hover { color: var(--brand); }
.cmt-empty { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* ---------- Kho đề thi ---------- */
.exam-tabs { display: flex; flex-wrap: wrap; margin: 14px 0 6px; border-bottom: 1px solid var(--line); }
.exam-tabs a { padding: 8px 16px 9px; font-weight: 700; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.exam-tabs a:first-child { padding-left: 0; }
.exam-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.exam-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 18px; }
.exam-cat { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 3px solid var(--brand); color: var(--ink); }
.exam-cat.c-vao10 { border-top-color: #1b4fb3; }
.exam-cat.c-hocky { border-top-color: #14804a; }
.exam-cat b { font: 700 16px/1.35 var(--serif); }
.exam-cat:hover b { color: var(--brand); }
.exam-cat small { font-size: 13.5px; color: #555; line-height: 1.5; }
.exam-year { margin-bottom: 22px; }
.exam-year h2 { font: 700 20px var(--serif); margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.exam-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.exam-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.exam-card:hover { color: var(--ink); }
.exam-card b { font: 700 15px/1.45 var(--serif); }
.exam-card:hover b { color: var(--brand); }
.exam-card small { color: var(--muted); font-size: 12.5px; }
.exam-kind { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--brand); }
.k-thi-thu .exam-kind { color: #1b4fb3; }
.k-giua-ki-1 .exam-kind, .k-giua-ki-2 .exam-kind { color: #14804a; }
.k-cuoi-ki-1 .exam-kind, .k-cuoi-ki-2 .exam-kind { color: #8a4b08; }
.k-chuyen .exam-kind { color: #6b2fb3; }
.exam-years { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.exam-yr { flex: 1 0 92px; display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); }
.exam-yr b { font: 700 19px var(--serif); }
.exam-yr small { color: var(--muted); font-size: 12px; }
.exam-yr:hover { background: var(--soft); color: var(--brand); }
.exam-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.exam-timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: 6px 10px; border: 1px solid #b9dcc6; color: #146c34; }
.exam-timer.late { border-color: #e7b5b8; color: var(--brand); }
.exam-paper { border: 1px solid var(--line); padding: 20px 24px; background: #fff; }
.exam-paper h2:first-child { margin-top: 0; }
.exam-answer-toggle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.exam-answer { border: 1px solid #cfe3d6; border-top: 3px solid #14804a; background: #fbfdfb; padding: 18px 24px; }
.exam-answer .ans-title { margin-top: 0; color: #146c34; }
.exam-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.exam-nav a { color: var(--link); }
@media print {
  .site-header, .site-footer, .aside, .exam-tools, .exam-answer-toggle, .exam-nav, .crumbs, .post-tags, #toast { display: none !important; }
  .layout { display: block; }
  .exam-paper { border: 0; padding: 0; }
  .exam-answer[hidden] { display: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .logo-sub { display: none; }
}
@media (max-width: 760px) {
  .topline-links { display: none; }
  .masthead { flex-wrap: wrap; gap: 10px 14px; padding: 10px 15px; }
  .logo-text { font-size: 26px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .hero { grid-template-columns: 1fr; }
  .lead h1 { font-size: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item { grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
  .item h3 { font-size: 15.5px; }
  .item .sapo { display: none; }
  .aside { grid-template-columns: 1fr; }
  .post h1 { font-size: 25px; }
  .post-body { font-size: 17px; }
  .post-figure .thumb { height: 220px; }
  .form .row, .form .row.two { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-name, .auth-area [data-auth="register"] { display: none; }
  .auth-area { margin-left: auto; }
  .fun-feed, .fun-feed.cols3 { grid-template-columns: 1fr; }
  .exam-row, .exam-cats { grid-template-columns: 1fr; }
  .exam-paper, .exam-answer { padding: 14px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
