:root {
  --qh-red-950: #450a0a;
  --qh-red-900: #7f1d1d;
  --qh-red-800: #991b1b;
  --qh-red-700: #b91c1c;
  --qh-red-600: #dc2626;
  --qh-red-50: #fef2f2;
  --qh-gold: #d4af37;
  --qh-gold-soft: #f8b805;
  --qh-cream: #f7f3ef;
  --qh-bg: #f9f9f8;
  --qh-surface: #ffffff;
  --qh-zinc-50: #fafafa;
  --qh-zinc-100: #f4f4f5;
  --qh-zinc-200: #e4e4e7;
  --qh-zinc-400: #a1a1aa;
  --qh-zinc-500: #71717a;
  --qh-zinc-700: #3f3f46;
  --qh-zinc-900: #18181b;
  --qh-text: #1a1c1b;
  --qh-radius: 12px;
  --qh-radius-lg: 16px;
  --qh-radius-xl: 24px;
  --qh-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --qh-font: "Roboto", system-ui, sans-serif;
  --qh-font-display: "Roboto", system-ui, sans-serif;
  --qh-header-h: 64px;
  --qh-bg-hd: url("/images/brand/bg-hd.png");
  --qh-bg-svg: url("/images/brand/bg.svg");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--qh-font);
  font-size: 1rem;
  font-optical-sizing: auto;
  color: var(--qh-text);
  background: var(--qh-bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 720px) {
  html {
    font-size: 14.5px;
  }

  .page-hero h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.65rem);
  }

  .page-hero p {
    font-size: .9rem;
  }

  .qh-brand {
    font-size: .95rem;
  }

  .home-block__title,
  .section-title,
  .cl-section__title {
    font-size: .88rem;
  }

  .cl-row__title,
  .pf-attempt__title,
  .news-list__title {
    font-size: .92rem;
  }

  .cl-btn {
    font-size: .76rem;
    padding: .42rem .8rem;
  }

  .pf-attempt__pct strong,
  .cl-row__pct strong {
    font-size: 1.35rem;
  }
}

/* Nền trang — kem + họa tiết trống đồng (bg.svg) */
.qh-body {
  background-color: var(--qh-cream);
  background-image:
    linear-gradient(180deg, rgba(247, 243, 239, .94) 0%, rgba(247, 243, 239, .88) 45%, rgba(243, 232, 224, .92) 100%),
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(153, 27, 27, .07), transparent 55%),
    var(--qh-bg-svg);
  background-size: auto, auto, min(920px, 140vw);
  background-attachment: fixed, fixed, fixed;
  background-position: center top, center top, center -8%;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

.qh-main {
  position: relative;
  z-index: 1;
}

a {
  color: var(--qh-red-800);
  text-decoration: none;
}

a:hover {
  color: var(--qh-red-700);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1280px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header — đỏ + bg-hd.png */
.qh-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--qh-header-h);
  background-color: var(--qh-red-900);
  background-image:
    linear-gradient(100deg, rgba(69, 10, 10, .88) 0%, rgba(127, 29, 29, .72) 42%, rgba(153, 27, 27, .78) 100%),
    var(--qh-bg-hd);
  background-size: auto, cover;
  background-position: center, center 35%;
  background-repeat: no-repeat;
  border-bottom: 2px solid var(--qh-gold);
  box-shadow: 0 6px 20px rgba(69, 10, 10, .28);
}

.qh-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.qh-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--qh-font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.qh-brand:hover {
  color: #ffe8a3;
}

.qh-brand__logo {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2));
}

.qh-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.qh-nav a {
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
  font-size: .9rem;
  padding: .5rem .85rem;
  border-radius: 8px;
}

.qh-nav a:hover,
.qh-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.qh-header__actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .7rem 1.15rem;
  cursor: pointer;
  transition: .15s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(.98);
}

.btn-primary {
  background: var(--qh-red-700);
  color: #fff;
  border-color: rgba(220, 38, 38, .45);
  box-shadow: 0 10px 24px rgba(127, 29, 29, .25);
}

.btn-primary:hover {
  background: var(--qh-red-800);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.btn-soft {
  background: rgba(255, 255, 255, .9);
  color: var(--qh-red-800);
  border-color: transparent;
}

.btn-login {
  background: #d4af37;
  color: #5c1a1a;
  padding: .5rem .85rem;
  font-size: .75rem;
  border-color: #f0d78c;
  gap: .3rem;
}

.btn-login .material-symbols-outlined {
  font-size: 1.05rem;
  line-height: 1;
}

.btn-login:hover {
  background: #f0d78c;
  color: #5c1a1a;
}

/* Hero — bg-hd + lớp màu đỏ / vàng */
.qh-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--qh-red-950);
  background-image:
    linear-gradient(155deg, rgba(45, 5, 8, .82) 0%, rgba(127, 29, 29, .62) 48%, rgba(69, 10, 10, .86) 100%),
    radial-gradient(ellipse 70% 80% at 80% 20%, rgba(248, 184, 5, .14), transparent 55%),
    var(--qh-bg-hd);
  background-size: auto, auto, cover;
  background-position: center, center, center 40%;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  padding: 3.75rem 1rem 3.4rem;
  border-bottom: 3px solid var(--qh-gold);
}

.qh-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--qh-bg-svg) center / min(720px, 95vw) no-repeat;
  opacity: .12;
  pointer-events: none;
  mix-blend-mode: screen;
}

.qh-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 42%),
    linear-gradient(0deg, rgba(45, 5, 8, .35), transparent 28%);
  pointer-events: none;
}

.qh-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
}

.qh-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem 1rem;
  border-radius: 999px;
  background: rgba(153, 27, 27, .45);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #fecaca;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

.qh-badge--live {
  background: rgba(22, 101, 52, .55);
  border-color: rgba(74, 222, 128, .45);
  color: #bbf7d0;
}

.qh-badge--up {
  background: rgba(3, 105, 161, .5);
  border-color: rgba(56, 189, 248, .4);
  color: #bae6fd;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .75;
  }
}

.qh-hero h1 {
  margin: 1rem 0 0;
  font-family: var(--qh-font-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 3.2vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

.qh-hero__meta {
  margin: 1rem auto 0;
  max-width: 40rem;
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #f4f4f5;
  font-size: .95rem;
  font-weight: 500;
}

.qh-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .85rem;
  margin-top: 1.75rem;
}

/* Main layout */
main {
  flex: 1;
}

.qh-section {
  padding: 2rem 0;
}

.qh-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .qh-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.panel {
  background: var(--qh-surface);
  border: 1px solid rgba(228, 228, 231, .7);
  border-radius: var(--qh-radius-xl);
  box-shadow: var(--qh-shadow);
  padding: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .85rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--qh-zinc-200);
}

.panel__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qh-red-800);
}

.dot-live {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--qh-red-600);
  animation: pulse 1.6s ease-in-out infinite;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: #fff;
  border: 1px solid var(--qh-zinc-100);
  border-radius: var(--qh-radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  transition: .2s ease;
}

.stat-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
}

.stat-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.stat-card__label {
  flex: 1;
  min-width: 0;
  color: var(--qh-zinc-500);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: keep-all;
}

.stat-card__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: var(--qh-red-50);
  color: var(--qh-red-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-card__value {
  margin-top: .85rem;
  font-family: var(--qh-font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--qh-zinc-900);
}

.section-title {
  margin: 0 0 .35rem;
  font-family: var(--qh-font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--qh-zinc-900);
}

.section-sub {
  margin: 0 0 1.25rem;
  color: var(--qh-zinc-500);
  font-size: .92rem;
}

.contest-list {
  display: grid;
  gap: 1rem;
}

.contest-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--qh-zinc-100);
  border-radius: var(--qh-radius-lg);
  background: #fff;
}

@media (min-width: 720px) {
  .contest-card {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.contest-card h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--qh-zinc-900);
  line-height: 1.35;
}

.contest-card p {
  margin: 0;
  color: var(--qh-zinc-500);
  font-size: .9rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.tag-live {
  background: #fee2e2;
  color: var(--qh-red-800);
}

.tag-up {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-end {
  background: var(--qh-zinc-100);
  color: var(--qh-zinc-500);
}

.side-card {
  background: #fff;
  border: 1px solid var(--qh-zinc-100);
  border-radius: var(--qh-radius-lg);
  padding: 1rem 1.1rem;
}

.side-card+.side-card {
  margin-top: .85rem;
}

.side-card h3 {
  margin: 0 0 .75rem;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qh-red-800);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.announce-item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.announce-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.announce-item strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--qh-zinc-900);
  font-size: .92rem;
}

.announce-item p {
  margin: 0;
  color: var(--qh-zinc-500);
  font-size: .85rem;
}

.announce-item time {
  display: block;
  margin-top: .35rem;
  color: var(--qh-zinc-400);
  font-size: .75rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--qh-zinc-100);
  font-size: .88rem;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .75rem;
  background: var(--qh-red-50);
  color: var(--qh-red-800);
}

.rank-row:nth-child(1) .rank-num {
  background: #fef08a;
  color: #854d0e;
}

.rank-row:nth-child(2) .rank-num {
  background: #e4e4e7;
  color: #3f3f46;
}

.rank-row:nth-child(3) .rank-num {
  background: #fdba74;
  color: #9a3412;
}

.rank-name {
  font-weight: 600;
  color: var(--qh-zinc-900);
}

.rank-org {
  color: var(--qh-zinc-400);
  font-size: .75rem;
}

.rank-score {
  font-weight: 800;
  color: var(--qh-red-800);
}

.empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--qh-zinc-500);
  background: var(--qh-zinc-50);
  border-radius: var(--qh-radius);
  border: 1px dashed var(--qh-zinc-200);
}

/* Forms */
.auth-wrap {
  max-width: 520px;
  margin: 2rem auto;
}

.auth-wrap.wide {
  max-width: 720px;
}

.form-card {
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: var(--qh-radius-xl);
  box-shadow: var(--qh-shadow);
  padding: 1.75rem;
}

.form-card h1 {
  margin: 0 0 .35rem;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--qh-red-800);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.form-card .lead {
  margin: 0 0 1.35rem;
  color: var(--qh-zinc-500);
  font-size: .92rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  margin-bottom: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--qh-zinc-700);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 10px;
  padding: .7rem .85rem;
  font: inherit;
  background: #fff;
  color: var(--qh-text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(185, 28, 28, .25);
  border-color: var(--qh-red-700);
}

.field-error {
  color: var(--qh-red-700);
  font-size: .8rem;
  margin-top: .3rem;
}

.validation-summary {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--qh-red-800);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}

.check {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  font-size: .88rem;
  color: var(--qh-zinc-700);
}

.check input {
  margin-top: .2rem;
}

.alert {
  border-radius: 10px;
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .9rem;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Exam */
.exam-shell {
  max-width: 860px;
  margin: 1rem auto 2rem;
}

.exam-top {
  position: sticky;
  top: calc(var(--qh-header-h) + .5rem);
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--qh-zinc-200);
  border-radius: var(--qh-radius-lg);
  padding: .85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  box-shadow: var(--qh-shadow);
}

.timer {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--qh-red-800);
  font-size: 1.15rem;
}

.progress-bar {
  height: .45rem;
  background: var(--qh-zinc-100);
  border-radius: 999px;
  overflow: hidden;
  margin: .75rem 0 1.25rem;
}

.progress-bar>span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--qh-red-700), var(--qh-red-900));
  width: 0;
  transition: width .25s ease;
}

.q-card {
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: var(--qh-radius-xl);
  padding: 1.35rem;
  box-shadow: var(--qh-shadow);
}

.q-card h2,
.question-content {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 700;
  color: inherit;
}
.question-content p { margin: 0 0 .55em; }
.question-content p:last-child { margin-bottom: 0; }
.question-content img { max-width: 100%; height: auto; border-radius: 8px; }
.question-content ul,
.question-content ol { margin: .35em 0 .75em; padding-left: 1.25rem; }

.option {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem 1rem;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 12px;
  margin-bottom: .65rem;
  cursor: pointer;
  transition: .15s ease;
}

.option:hover {
  border-color: #fca5a5;
  background: #fff7f7;
}

.option.is-selected {
  border-color: var(--qh-red-700);
  background: var(--qh-red-50);
  box-shadow: inset 0 0 0 1px var(--qh-red-700);
}

.option input {
  margin-top: .2rem;
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.25rem;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th,
table.data td {
  padding: .75rem .65rem;
  border-bottom: 1px solid var(--qh-zinc-100);
  text-align: left;
}

table.data th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--qh-zinc-500);
}

/* Footer — đỏ đảng sáng hơn + vàng + chữ trắng */
.qh-footer {
  position: relative;
  margin-top: auto;
  overflow: hidden;
  border-top: 3px solid var(--qh-gold);
  padding: 2.5rem 0 1.5rem;
  font-size: .88rem;
  color: #fff;
}

.qh-footer__bg {
  position: absolute;
  inset: 0;
  background-color: #b91c1c;
  background-image:
    linear-gradient(165deg, #dc2626 0%, #b91c1c 38%, #991b1b 72%, #7f1d1d 100%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(212, 175, 55, .22), transparent 58%),
    var(--qh-bg-svg);
  background-size: auto, auto, min(980px, 160vw);
  background-position: center, center, center 30%;
  background-repeat: no-repeat;
  z-index: 0;
}

.qh-footer__content {
  position: relative;
  z-index: 1;
}

.qh-footer__logo {
  height: 42px;
  width: auto;
  margin-bottom: .75rem;
  filter: brightness(1.05);
}

.qh-footer__grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .qh-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.qh-footer h4 {
  margin: 0 0 .85rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--qh-gold-soft);
}

.qh-footer .org {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.qh-footer p,
.qh-footer li {
  color: rgba(255, 255, 255, .92);
}

.qh-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.qh-footer li+li {
  margin-top: .55rem;
}

.qh-footer a {
  color: #fff;
}

.qh-footer a:hover {
  color: var(--qh-gold-soft);
}

.qh-footer__bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 215, 110, .35);
  color: rgba(255, 255, 255, .85);
  font-size: .8rem;
  text-align: center;
}

.qh-footer__dev {
  color: var(--qh-gold-soft);
  font-weight: 700;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 8px;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .qh-header {
    height: auto;
    min-height: var(--qh-header-h);
  }

  .qh-header__inner {
    height: auto;
    min-height: var(--qh-header-h);
    padding: .55rem 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
  }

  .qh-header__actions {
    gap: .35rem;
    flex-shrink: 0;
  }

  .qh-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #7f1d1d;
    border-bottom: 1px solid rgba(212, 175, 55, .35);
    flex-direction: column;
    align-items: stretch;
    padding: .75rem;
  }

  .qh-nav.is-open {
    display: flex;
  }

  .qh-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    max-width: calc(100% - 3.5rem);
    white-space: normal;
    font-size: .78rem;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .qh-brand__logo {
    height: 30px;
  }

  .qh-brand span {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: none;
  }
}

.page-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--qh-red-900);
  background-image:
    linear-gradient(120deg, rgba(69, 10, 10, .86) 0%, rgba(127, 29, 29, .7) 50%, rgba(90, 10, 12, .84) 100%),
    var(--qh-bg-hd);
  background-size: auto, cover;
  background-position: center, center 42%;
  background-repeat: no-repeat;
  color: #fff;
  padding: 2.15rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--qh-gold);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--qh-bg-svg) right -10% center / min(520px, 70vw) no-repeat;
  opacity: .14;
  pointer-events: none;
  mix-blend-mode: screen;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.page-hero p {
  margin: .4rem 0 0;
  opacity: .9;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: middle;
}

/* ===== Leaderboard ===== */
.lb-panel {
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: var(--qh-radius-xl);
  box-shadow: var(--qh-shadow);
  padding: 1.25rem;
}

.lb-toolbar {
  display: grid;
  gap: .85rem;
  margin-bottom: 1rem;
  align-items: end;
}

@media (min-width: 960px) {
  .lb-toolbar {
    grid-template-columns: minmax(0, 1.1fr) auto;
  }
}

.lb-contest label {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
  margin-bottom: .3rem;
}

.lb-contest__control {
  display: flex;
  align-items: center;
  gap: .4rem;
  max-width: 34rem;
  background: #fafafa;
  border-radius: 9px;
  padding: .2rem .55rem .2rem .5rem;
  border: 1px solid var(--qh-zinc-200);
  min-height: 2.15rem;
}

.lb-contest__control .material-symbols-outlined {
  font-size: 1.05rem;
  color: var(--qh-red-800);
}

.lb-contest__control select,
.lb-contest__control .ac__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.25;
  padding: .35rem 0;
  outline: none;
  color: var(--qh-zinc-800);
}

.lb-contest .ac {
  max-width: 34rem;
}

.lb-contest .ac__chevron {
  color: var(--qh-zinc-500) !important;
  font-size: 1.1rem !important;
  cursor: pointer;
  user-select: none;
}

/* Autocomplete */
.ac {
  position: relative;
  width: 100%;
}

.ac--search {
  flex: 1 1 14rem;
  max-width: 26rem;
  min-width: 12rem;
}

.ac__list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: .35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(24, 24, 27, .12);
  max-height: 280px;
  overflow: auto;
}

.ac__option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: .55rem .6rem;
  cursor: pointer;
  font: inherit;
  color: var(--qh-zinc-800);
}

.ac__option:hover,
.ac__option:focus {
  background: var(--qh-red-50);
  outline: none;
}

.ac__option .material-symbols-outlined {
  color: var(--qh-red-800);
  font-size: 1.15rem;
  margin-top: .05rem;
}

.ac__option-text,
.ac__option-main {
  flex: 1;
  min-width: 0;
}

.ac__option-text {
  font-size: .86rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ac__option-main strong {
  display: block;
  font-size: .86rem;
  font-weight: 700;
  color: var(--qh-zinc-900);
}

.ac__option-main small {
  display: block;
  margin-top: .15rem;
  font-size: .72rem;
  color: var(--qh-zinc-500);
}

.ac__empty {
  padding: .7rem .75rem;
  font-size: .84rem;
  color: var(--qh-zinc-500);
}

.lb-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(5.5rem, auto));
  gap: .5rem;
}

.lb-stat {
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 10px;
  padding: .45rem .7rem;
  text-align: center;
  min-width: 6.5rem;
}

.lb-stat span {
  display: block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
}

.lb-stat strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
  line-height: 1.2;
}

.lb-stat strong.is-red {
  color: var(--qh-red-800);
}

.lb-stat strong.is-blue {
  color: #1d4ed8;
}

.lb-podium-wrap {
  margin: 1.5rem 0 1.75rem;
  text-align: center;
}

.lb-podium-badge {
  display: inline-block;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 1rem;
}

.lb-podium {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  align-items: end;
}

/* Mobile: quán quân (#1) lên đầu; Desktop DOM sẵn #2 · #1 · #3 */
@media (max-width: 799px) {
  .lb-podium-card.place-1 { order: -1; }
}

@media (min-width: 800px) {
  .lb-podium {
    grid-template-columns: 1fr 1.15fr 1fr;
  }
}

.lb-podium-card {
  border: 2px solid var(--qh-zinc-200);
  border-radius: 18px;
  background: #fafafa;
  padding: 1.1rem 1rem;
  text-align: center;
  cursor: pointer;
  font: inherit;
  width: 100%;
  transition: .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-podium-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--qh-shadow);
}

.lb-podium-card.place-1 {
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border-color: #f59e0b;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
}

.lb-podium-card.place-2 {
  background: #f8fafc;
  border-color: #94a3b8;
}

.lb-podium-card.place-3 {
  background: #fff7ed;
  border-color: #fdba74;
}

.lb-podium-crown {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 100%;
  color: #b45309;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: .4rem;
  text-align: center;
}

.lb-podium-crown .material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
}

.lb-podium-rank {
  display: grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  font-weight: 900;
  margin: 0 auto .55rem;
  background: #e4e4e7;
  color: #3f3f46;
}

.place-1 .lb-podium-rank {
  background: #f59e0b;
  color: #fff;
}

.place-2 .lb-podium-rank {
  background: #94a3b8;
  color: #fff;
}

.place-3 .lb-podium-rank {
  background: #fb923c;
  color: #fff;
}

.lb-podium-name {
  font-weight: 800;
  color: #7f1d1d;
  margin-bottom: .75rem;
  line-height: 1.35;
}

.lb-podium-score {
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding-top: .75rem;
}

.lb-podium-score strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
}

.lb-podium-score span {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
}

.lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 1rem 0;
}

.lb-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--qh-zinc-200);
  background: #fff;
  color: var(--qh-zinc-700);
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
}

.lb-tab em {
  font-style: normal;
  background: #f4f4f5;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .75rem;
  font-weight: 800;
}

.lb-tab.is-active {
  background: var(--qh-red-800);
  border-color: var(--qh-red-800);
  color: #fff;
}

.lb-tab.is-active em {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.lb-tab:hover {
  color: var(--qh-red-800);
}

.lb-searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .85rem;
}

.lb-search {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: #fafafa;
  border-radius: 9px;
  padding: .15rem .55rem;
  border: 1px solid var(--qh-zinc-200);
  min-height: 2.1rem;
  width: 100%;
}

.lb-searchbar>.lb-search,
.lb-searchbar>.ac--search {
  flex: 1 1 14rem;
  max-width: 26rem;
  min-width: 12rem;
}

.lb-search .material-symbols-outlined {
  font-size: 1.05rem;
  color: var(--qh-zinc-500);
}

.lb-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .84rem;
  padding: .3rem 0;
  outline: none;
  color: var(--qh-zinc-800);
}

.lb-search input::placeholder {
  color: #a1a1aa;
}

.lb-searchbar__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .85rem;
  align-items: center;
  color: var(--qh-zinc-500);
  font-size: .82rem;
}

.lb-searchbar__meta strong {
  color: var(--qh-zinc-800);
}

.lb-searchbar__meta label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--qh-zinc-500);
}

.lb-searchbar__meta select {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 8px;
  padding: .28rem .45rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--qh-zinc-800);
  background: #fff;
  min-height: 2rem;
  min-width: 3.6rem;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.lb-table th,
.lb-table td {
  padding: .9rem .65rem;
  border-bottom: 1px solid var(--qh-zinc-100);
  text-align: left;
  vertical-align: middle;
}

.lb-table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--qh-zinc-500);
  white-space: nowrap;
  vertical-align: bottom;
}

.lb-sort {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  max-width: 100%;
}

.lb-sort .material-symbols-outlined {
  font-size: 1rem;
  opacity: .45;
  flex-shrink: 0;
}

.lb-sort:hover {
  color: var(--qh-red-800);
}

.lb-sort:hover .material-symbols-outlined {
  opacity: .85;
}

.lb-sort.is-active {
  color: var(--qh-red-800);
}

.lb-sort.is-active .material-symbols-outlined {
  opacity: 1;
  color: var(--qh-red-800);
}

.lb-table td.num {
  font-weight: 800;
  text-align: center;
}

.lb-table td.pass {
  color: #15803d;
}

.lb-table th:nth-child(3),
.lb-table th:nth-child(4),
.lb-table th:nth-child(5),
.lb-table th:nth-child(6) {
  text-align: center;
}

.lb-table th:nth-child(3) .lb-sort,
.lb-table th:nth-child(4) .lb-sort,
.lb-table th:nth-child(5) .lb-sort,
.lb-table th:nth-child(6) .lb-sort {
  justify-content: center;
}

.lb-rank {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: .85rem;
  background: #f4f4f5;
  color: #52525b;
}

.lb-rank.r1 {
  background: #fde68a;
  color: #92400e;
}

.lb-rank.r2 {
  background: #e2e8f0;
  color: #334155;
}

.lb-rank.r3 {
  background: #fdba74;
  color: #9a3412;
}

.lb-org strong {
  display: block;
  color: var(--qh-zinc-900);
}

.lb-org__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .35rem;
}

.tag-top {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-red-800);
}

.tag-kind {
  font-size: .68rem;
  font-weight: 700;
  background: #f4f4f5;
  color: #71717a;
  border-radius: 999px;
  padding: .15rem .45rem;
}

.btn-parti {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid var(--qh-zinc-200);
  background: #fff;
  border-radius: 999px;
  padding: .4rem .75rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  color: var(--qh-red-800);
  cursor: pointer;
}

.btn-parti:hover {
  background: var(--qh-red-50);
}

.lb-paging {
  display: flex;
  gap: .65rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  color: var(--qh-zinc-500);
  font-size: .9rem;
}

.lb-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 15, 15, .45);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lb-modal[hidden] {
  display: none !important;
}

.lb-modal__dialog {
  width: min(1100px, 100%);
  max-height: min(90vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

.lb-modal__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.lb-modal__head>div:first-child {
  display: flex;
  gap: .85rem;
  align-items: center;
}

.lb-modal__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #ffe4e6;
  color: var(--qh-red-800);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lb-modal__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.lb-modal__head p {
  margin: .2rem 0 0;
  color: var(--qh-zinc-500);
  font-size: .85rem;
}

.lb-modal__close {
  border: 0;
  background: #f4f4f5;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.lb-modal__tools {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.25rem;
}

.badge-red {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  padding: .1rem .55rem;
  font-weight: 800;
}

.lb-modal__table {
  padding: 0 1.25rem;
  overflow: auto;
  flex: 1;
}

.lb-modal__foot {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: .9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .78rem;
  font-weight: 800;
}

.pill-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill-gold {
  background: #fef3c7;
  color: #92400e;
}

/* ===== Contest list page ===== */
.cl-hero {
  padding: 1.75rem 0 .5rem;
}

.cl-hero__title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .55rem;
}

.cl-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--qh-zinc-900);
}

.cl-hero h1 em {
  font-style: normal;
  color: var(--qh-red-800);
}

.cl-hero p {
  margin: 0;
  max-width: 52rem;
  color: var(--qh-zinc-500);
  font-size: .95rem;
  line-height: 1.55;
}

.cl-accent {
  display: inline-block;
  width: 4px;
  height: 1.15em;
  background: var(--qh-red-800);
  border-radius: 2px;
  flex-shrink: 0;
}

.cl-page {
  padding-top: 1rem;
}

.cl-panel {
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 22px;
  box-shadow: var(--qh-shadow);
}

.cl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
}

.cl-toolbar>.ac--search {
  flex: 1 1 14rem;
  max-width: 26rem;
  min-width: 12rem;
}

.cl-search {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: #fafafa;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 9px;
  padding: .15rem .55rem;
  min-height: 2.1rem;
  width: 100%;
}

.cl-search .material-symbols-outlined {
  font-size: 1.05rem;
  color: var(--qh-zinc-500);
}

.cl-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .84rem;
  padding: .3rem 0;
  outline: none;
}

.cl-search input::placeholder {
  color: #a1a1aa;
}

.cl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  align-items: end;
}

.cl-filters label {
  display: grid;
  gap: .18rem;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
}

.cl-filters select {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 8px;
  padding: .3rem .5rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--qh-zinc-800);
  background: #fff;
  min-width: 7.5rem;
  min-height: 2rem;
}

.cl-filters .btn,
.cl-filters .cl-btn--filter {
  padding: .35rem .85rem;
  font-size: .8rem;
  min-height: 2rem;
  align-self: end;
}

.cl-btn--filter {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.cl-btn--filter .material-symbols-outlined {
  font-size: 1.05rem;
  line-height: 1;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .85rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: .85rem;
  padding: .75rem .9rem;
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: var(--qh-radius-lg);
  box-shadow: var(--qh-shadow);
}

.list-toolbar>.ac--search {
  flex: 1 1 14rem;
  min-width: 12rem;
  max-width: 28rem;
  position: relative;
}

.list-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  align-items: end;
}

.list-toolbar__right label {
  display: grid;
  gap: .18rem;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
}

.list-toolbar__right select {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 8px;
  padding: .3rem .5rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--qh-zinc-800);
  background: #fff;
  min-width: 8rem;
  min-height: 2rem;
}

.list-toolbar__right .cl-btn--filter {
  padding: .35rem .85rem;
  font-size: .8rem;
  min-height: 2rem;
}

.cl-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.cl-section+.cl-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.cl-section__title {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  font-size: .95rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-900);
}

.cl-list {
  display: grid;
  gap: .75rem;
  min-width: 0;
  max-width: 100%;
}

.cl-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--qh-zinc-500);
  background: #fafafa;
  border: 1px dashed var(--qh-zinc-200);
  border-radius: 14px;
}

.cl-row {
  display: grid;
  gap: .85rem;
  align-items: center;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 14px;
  background: #fff;
  padding: .95rem 1.1rem;
  transition: box-shadow .15s ease, border-color .15s ease;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.cl-row:hover {
  border-color: #fecaca;
  box-shadow: 0 8px 22px rgba(127, 29, 29, .06);
}

.cl-row.is-ongoing {
  border-left: 3px solid var(--qh-red-700);
}

.cl-row.is-ended {
  background: #fcfcfc;
}

.cl-row__main {
  min-width: 0;
  width: 100%;
}

@media (min-width: 1100px) {
  .cl-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
  }
}

.cl-row__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  margin-bottom: .35rem;
}

.cl-kind {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--qh-red-800, #991b1b);
  background: rgba(185, 28, 28, .08);
  border: 1px solid rgba(185, 28, 28, .18);
}
.cl-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
  white-space: nowrap;
}

.cl-status i {
  width: .45rem;
  height: .45rem;
  border-radius: 999px;
  background: #a1a1aa;
  display: inline-block;
}

.cl-status.is-live {
  color: #15803d;
}

.cl-status.is-live i {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
  animation: cl-pulse 1.6s ease infinite;
}

.cl-status.is-up {
  color: #0369a1;
}

.cl-status.is-up i {
  background: #0ea5e9;
}

.cl-status.is-end {
  color: #71717a;
}

@keyframes cl-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .05);
  }
}

.cl-row__title {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .005em;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cl-row__title a {
  color: var(--qh-zinc-900);
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  hyphens: auto;
}

.cl-row__title a:hover {
  color: var(--qh-red-800);
}

.cl-row__desc {
  margin: 0 0 .55rem;
  max-width: 100%;
  min-width: 0;
  color: var(--qh-zinc-500);
  font-size: .86rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cl-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .85rem;
  color: var(--qh-zinc-700);
  font-size: .84rem;
  font-weight: 600;
}

.cl-row__meta>span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}

.cl-row__meta .material-symbols-outlined {
  color: var(--qh-red-800);
  font-size: 1.05rem;
}

.cl-row__when {
  color: var(--qh-zinc-500);
  font-weight: 600;
}

.cl-row__when .material-symbols-outlined {
  color: #a1a1aa;
}

.cl-row__side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem .75rem;
  width: 100%;
  min-width: 0;
}

.cl-row__side>.cl-live {
  width: 100%;
}

.cl-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label btn"
    "boxes btn";
  column-gap: .75rem;
  row-gap: .28rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.cl-countdown__label {
  grid-area: label;
  justify-self: start;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9a3412;
}

.cl-live__btn {
  grid-area: btn;
  align-self: center;
  justify-self: end;
  height: 2.55rem;
  padding-inline: 1rem;
  white-space: nowrap;
}

.cl-countdown__boxes {
  grid-area: boxes;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: .15rem;
  background: linear-gradient(180deg, #fffaf3, #f8efe3);
  border: 1px solid #ecd9bf;
  border-radius: 11px;
  padding: .4rem .55rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  min-height: 2.55rem;
  width: max-content;
  max-width: 100%;
}

@media (max-width: 560px) {
  .cl-live {
    column-gap: .55rem;
  }

  .cl-countdown__boxes {
    padding: .35rem .4rem;
  }

  .cl-countdown__boxes>div {
    min-width: 2.1rem;
  }

  .cl-countdown__boxes strong {
    font-size: .92rem;
  }

  .cl-live__btn {
    height: 2.4rem;
    padding-inline: .75rem;
    font-size: .75rem;
  }
}

.cl-countdown__boxes>div {
  min-width: 2.45rem;
  text-align: center;
  padding: 0 .1rem;
}

.cl-countdown__boxes strong {
  display: block;
  font-size: 1rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.cl-countdown__boxes span {
  display: block;
  margin-top: .12rem;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a16207;
}

.cl-countdown__boxes em {
  font-style: normal;
  font-weight: 900;
  color: #d97706;
  padding: 0 .08rem;
  align-self: center;
  font-size: .95rem;
  line-height: 1;
  margin-bottom: .55rem;
}

.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  white-space: nowrap;
  border-radius: 999px;
  padding: .48rem .95rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: .15s ease;
  line-height: 1.2;
}

.cl-btn .material-symbols-outlined {
  font-size: 1.05rem;
}

.cl-btn--primary {
  background: linear-gradient(180deg, var(--qh-red-700), var(--qh-red-800));
  color: #fff;
  border-color: var(--qh-red-900);
  box-shadow: 0 6px 16px rgba(127, 29, 29, .28);
}

.cl-btn--primary:hover {
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.cl-btn--ghost {
  background: #fff;
  color: var(--qh-red-800);
  border-color: #fecaca;
  box-shadow: 0 1px 2px rgba(127, 29, 29, .04);
}

.cl-btn--ghost:hover {
  background: var(--qh-red-50);
  color: var(--qh-red-900);
  border-color: #fca5a5;
}

.cl-btn--rank {
  background: var(--qh-red-800);
  color: #fff;
  border-color: var(--qh-red-900);
  box-shadow: 0 4px 12px rgba(127, 29, 29, .18);
}

.cl-btn--rank:hover {
  background: var(--qh-red-900);
  color: #fff;
}

.cl-row__ended {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  width: 100%;
}

.cl-row__pct {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

@media (max-width: 720px) {
  .cl-row__ended {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
  }

  .cl-row__pct {
    align-items: flex-start;
    flex-shrink: 0;
  }

  .cl-row__pct strong {
    font-size: 1.35rem;
  }

  .cl-row__actions {
    margin-left: auto;
  }
}

.cl-row__pct strong {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--qh-red-700);
  font-variant-numeric: tabular-nums;
}

.cl-row__pct.is-pass strong {
  color: #15803d !important;
}

.cl-row__pct.is-fail strong {
  color: #dc2626 !important;
}

.cl-row__pct span {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--qh-zinc-500);
}

.cl-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-end;
}

.cl-paging {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  color: var(--qh-zinc-500);
  font-size: .9rem;
}

/* ===== Home page ===== */
.home-page {
  padding-top: 1.25rem;
}

.home-main {
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}

.home-stats-panel {
  padding-bottom: 1rem;
}

.home-stats-contest {
  display: inline;
  color: var(--qh-zinc-700);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-stats {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: .75rem;
}

@media (min-width: 1100px) {
  .home-stats.home-stats--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .home-stats.home-stats--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.cd-overview {
  margin: 0;
}

@media (max-width: 720px) {
  .cd-overview .home-stats.home-stats--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.home-stats .stat-card {
  padding: .9rem 1rem;
}

.home-stats .stat-card__label {
  font-size: .65rem;
  letter-spacing: .02em;
}

.home-stats .stat-card__value {
  margin-top: .55rem;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
}

.stat-card__bar {
  margin-top: .55rem;
  height: 4px;
  border-radius: 999px;
  background: #fee2e2;
  overflow: hidden;
}

.stat-card__bar span {
  display: block;
  height: 100%;
  background: var(--qh-red-700);
  border-radius: inherit;
}

.home-block {
  padding: 1rem 1.1rem 1.15rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.home-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .85rem;
  margin-bottom: .85rem;
}

.home-block__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-900);
}

.home-link-all {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .82rem;
  font-weight: 800;
  color: var(--qh-red-800);
  text-decoration: none;
}

.home-link-all .material-symbols-outlined {
  font-size: 1rem;
}

.home-link-all:hover {
  color: var(--qh-red-900);
}

.home-block__foot {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.home-aside {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.home-aside .side-card {
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.side-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  margin-bottom: .75rem;
}

.side-card__head h3 {
  margin: 0;
}

.side-card__foot {
  margin-top: .9rem;
}

.home-rank-contest {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: .78rem;
  font-weight: 600;
  color: var(--qh-zinc-600);
  background: #fafafa;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 8px;
  padding: .4rem .6rem;
  margin-bottom: .65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-rank-list {
  display: grid;
  gap: .35rem;
}

.home-aside .rank-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  padding: .45rem .5rem;
  border-radius: 10px;
}

.home-aside .rank-row.is-top {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.home-aside .rank-row.is-top .rank-num {
  background: #f59e0b;
  color: #fff;
}

.home-aside .rank-body {
  min-width: 0;
}

.home-aside .rank-name {
  font-size: .84rem;
  font-weight: 700;
  color: var(--qh-zinc-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-aside .rank-org {
  font-size: .72rem;
  color: var(--qh-zinc-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-aside .rank-score {
  font-size: .9rem;
  font-weight: 800;
  color: var(--qh-red-800);
}

/* ===== App dialog (thay alert/confirm) ===== */
.qh-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(24, 24, 27, .48);
  opacity: 0;
  transition: opacity .16s ease;
}

.qh-dialog-overlay.is-open {
  opacity: 1;
}

.qh-dialog-overlay.is-closing {
  opacity: 0;
}

.qh-dialog {
  width: min(100%, 26rem);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
  padding: 1.35rem 1.35rem 1.2rem;
  text-align: center;
  transform: translateY(8px) scale(.98);
  transition: transform .16s ease;
  outline: none;
}

.qh-dialog-overlay.is-open .qh-dialog {
  transform: none;
}

.qh-dialog__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto .75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: var(--qh-red-800);
}

.qh-dialog-overlay.is-info .qh-dialog__icon {
  background: #eff6ff;
  color: #1d4ed8;
}

.qh-dialog__icon .material-symbols-outlined {
  font-size: 1.55rem;
}

.qh-dialog__title {
  margin: 0 0 .4rem;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
}

.qh-dialog__msg {
  margin: 0 0 1.15rem;
  font-size: .95rem;
  color: var(--qh-zinc-700);
  line-height: 1.5;
}

.qh-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}

.qh-dialog__actions .cl-btn {
  min-width: 6.5rem;
  justify-content: center;
}

/* ===== Profile ===== */
.pf-hero .container {
  position: relative;
  z-index: 1;
}

.pf-hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.pf-avatar {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--qh-red-900);
  background: linear-gradient(160deg, #fff 0%, #fee2e2 100%);
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  flex-shrink: 0;
}

.pf-kicker {
  margin: 0 0 .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}

.pf-hero__text {
  flex: 1 1 14rem;
  min-width: 0;
}

.pf-hero__text h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}

.pf-hero__sub {
  margin: .35rem 0 0;
  font-size: .9rem;
  opacity: .92;
  line-height: 1.4;
}

.pf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-left: auto;
}

.pf-btn-light {
  background: rgba(255, 255, 255, .14) !important;
  border-color: rgba(255, 255, 255, .45) !important;
  color: #fff !important;
}

.pf-btn-light:hover {
  background: rgba(255, 255, 255, .24) !important;
}

.pf-page {
  padding-top: 0;
}

.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: -.85rem 0 1.15rem;
  position: relative;
  z-index: 2;
}

.pf-stat {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: #fff;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 14px;
  padding: .85rem 1rem;
  box-shadow: var(--qh-shadow);
}

.pf-stat.is-live {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
}

.pf-stat__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: var(--qh-red-800);
  font-size: 1.2rem;
}

.pf-stat strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
  line-height: 1.1;
}

.pf-stat span:last-child {
  font-size: .75rem;
  font-weight: 600;
  color: var(--qh-zinc-500);
}

.pf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.pf-card {
  padding: 1.1rem 1.2rem 1.2rem;
}

.pf-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.25rem;
  margin: .35rem 0 0;
}

.pf-field {
  margin: 0;
  padding: .75rem .85rem;
  background: #fafafa;
  border: 1px solid var(--qh-zinc-100);
  border-radius: 12px;
}

.pf-field dt {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .3rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pf-field dt .material-symbols-outlined {
  font-size: 1rem;
  color: var(--qh-red-700);
}

.pf-field dd {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--qh-zinc-900);
  line-height: 1.35;
  word-break: break-word;
}

.pf-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.pf-tips {
  list-style: none;
  margin: .25rem 0 0;
  padding: 0;
  display: grid;
  gap: .85rem;
}

.pf-tips li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: start;
}

.pf-tips .material-symbols-outlined {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: var(--qh-red-800);
  font-size: 1.15rem;
}

.pf-tips strong {
  display: block;
  font-size: .88rem;
  color: var(--qh-zinc-900);
  margin-bottom: .15rem;
}

.pf-tips p {
  margin: 0;
  font-size: .8rem;
  color: var(--qh-zinc-550, #71717a);
  line-height: 1.45;
}

.pf-attempts {
  display: grid;
  gap: .65rem;
  margin-top: .35rem;
}

.pf-attempt {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fcfcfc 100%);
}

.pf-attempt__main {
  flex: 1 1 16rem;
  min-width: 0;
}

.pf-attempt__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  margin-bottom: .35rem;
}

.pf-attempt__round {
  font-size: .72rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
  background: #f4f4f5;
  border-radius: 999px;
  padding: .15rem .55rem;
}

.pf-attempt__title {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
  color: var(--qh-zinc-900);
  line-height: 1.35;
}

.pf-attempt__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--qh-zinc-600);
}

.pf-attempt__meta strong {
  color: var(--qh-red-800);
  font-weight: 800;
}

.pf-attempt__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .45rem;
  flex-shrink: 0;
  min-width: 9.5rem;
}

.pf-attempt__pct {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.pf-attempt__pct strong {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--qh-red-700);
}

.pf-attempt__pct span {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--qh-zinc-500);
}

.pf-attempt__pct.is-pass strong {
  color: #15803d !important;
}

.pf-attempt__pct.is-fail strong {
  color: #dc2626 !important;
}

.pf-attempt__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-end;
}

.hist-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  min-width: 9rem;
}

.lb-table td .hist-side .pf-attempt__pct strong {
  font-size: 1.35rem;
}

.hist-list {
  margin-top: .35rem;
}

@media (max-width: 720px) {

  .pf-attempt,
  .hist-list .pf-attempt {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .65rem;
  }

  .pf-attempt__main,
  .hist-list .pf-attempt__main {
    flex: 0 0 auto;
    width: 100%;
  }

  .pf-attempt__side,
  .hist-list .pf-attempt__side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
  }

  .pf-attempt__pct,
  .hist-list .pf-attempt__pct {
    align-items: flex-start;
  }

  .pf-attempt__actions,
  .hist-list .pf-attempt__actions {
    margin-left: auto;
  }
}

.lb-cards {
  display: none;
}

.lb-card {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 14px;
  background: #fff;
  padding: .9rem 1rem;
  display: grid;
  gap: .75rem;
}

.lb-card__top {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.lb-card__top .lb-org {
  flex: 1;
  min-width: 0;
}

.lb-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .75rem;
}

.lb-card__stats>div {
  background: #fafafa;
  border: 1px solid var(--qh-zinc-100);
  border-radius: 10px;
  padding: .55rem .65rem;
}

.lb-card__stats span {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-zinc-500);
}

.lb-card__stats strong {
  display: block;
  margin-top: .2rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--qh-zinc-900);
}

.lb-card__stats strong.is-pass {
  color: #15803d;
}

.lb-card__stats strong.is-fail {
  color: #dc2626;
}

.lb-card__foot {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 800px) {
  .lb-desk {
    display: none;
  }

  .lb-cards {
    display: grid;
    gap: .75rem;
    margin-top: .25rem;
  }
}

.cl-status.is-pass,
.cl-status.is-fail {
  padding: .2rem .55rem;
  border-radius: 999px;
}

.cl-status.is-pass {
  color: #166534;
  background: #dcfce7;
}

.cl-status.is-pass i {
  background: #16a34a;
  box-shadow: none;
  animation: none;
}

.cl-status.is-fail {
  color: #991b1b;
  background: #fee2e2;
}

.cl-status.is-fail i {
  background: #dc2626;
  box-shadow: none;
  animation: none;
}

.pill-green {
  background: #dcfce7;
  color: #166534;
}

.pill-red {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 900px) {
  .pf-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .pf-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin-top: -.5rem;
  }

  .pf-stat {
    padding: .7rem .7rem;
    gap: .5rem;
  }

  .pf-stat__icon {
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .pf-stat strong {
    font-size: 1.1rem;
  }

  .pf-stat span:last-child {
    font-size: .7rem;
  }

  .pf-fields {
    grid-template-columns: 1fr;
  }

  .pf-hero__actions {
    width: 100%;
    margin-left: 0;
  }

  .pf-hero__actions .cl-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ===== Contest detail page ===== */
.cd-kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}

.cd-hero__time {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: .65rem 0 0;
  font-size: .9rem;
  opacity: .92;
}

.cd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, .9fr);
  gap: 1.15rem;
  align-items: start;
}

.cd-main {
  display: grid;
  gap: 1.1rem;
}

.cd-aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: calc(var(--qh-header-h) + .75rem);
}

.cd-block__title {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--qh-red-900);
}

.cd-empty {
  padding: 1rem;
  border: 1px dashed var(--qh-zinc-200);
  border-radius: 12px;
  color: var(--qh-zinc-500);
  font-size: .9rem;
  text-align: center;
}

.cd-accordion {
  display: grid;
  gap: .45rem;
}

.cd-acc {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.cd-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  font-weight: 700;
  color: var(--qh-zinc-900);
}

.cd-acc summary::-webkit-details-marker {
  display: none;
}

.cd-acc summary .material-symbols-outlined {
  color: var(--qh-zinc-400);
  transition: transform .15s ease;
}

.cd-acc[open] summary .material-symbols-outlined {
  transform: rotate(180deg);
  color: var(--qh-red-700);
}

.cd-acc__body {
  padding: 0 1rem 1rem;
  color: var(--qh-zinc-700);
  font-size: .92rem;
  line-height: 1.6;
  border-top: 1px solid var(--qh-zinc-100);
  padding-top: .85rem;
}

.cd-acc__body p {
  margin: 0 0 .65rem;
}

.cd-acc__body ul {
  margin: .35rem 0 .65rem 1.1rem;
  padding: 0;
}

.cd-news {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cd-news li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: .85rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.cd-news li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cd-news time {
  font-size: .82rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
}

.cd-news strong {
  display: block;
  color: var(--qh-red-800);
  font-size: .92rem;
  margin-bottom: .2rem;
}

.cd-news p {
  margin: 0;
  font-size: .84rem;
  color: var(--qh-zinc-600);
  line-height: 1.45;
}

.cd-share {
  text-align: center;
  padding: 1.15rem 1rem 1.2rem;
}

.cd-qr {
  display: inline-block;
  padding: .85rem .85rem .55rem;
  border: 2px solid var(--qh-red-700);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}

.cd-qr img {
  display: block;
  width: 180px;
  height: 180px;
}

.cd-qr__brand {
  margin-top: .45rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--qh-red-800);
}

.cd-share__hint {
  margin: .85rem 0 .7rem;
  font-weight: 800;
  color: var(--qh-zinc-900);
}

.cd-link {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--qh-red-700);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  text-align: left;
}

.cd-link>.material-symbols-outlined {
  display: grid;
  place-items: center;
  padding: 0 .55rem;
  color: #2563eb;
  background: #eff6ff;
}

.cd-link input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: .55rem .35rem;
  font-size: .78rem;
  color: var(--qh-zinc-700);
  background: transparent;
}

.cd-link__copy {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 0;
  border-left: 1px solid var(--qh-zinc-200);
  background: #f4f4f5;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 700;
  padding: 0 .7rem;
  cursor: pointer;
  white-space: nowrap;
}

.cd-link__copy:hover {
  background: #e4e4e7;
}

.cd-link__copy .material-symbols-outlined {
  font-size: 1rem;
}

.cd-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  padding: 1rem;
}

.cd-quick__item {
  display: grid;
  justify-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--qh-red-900);
  font-size: .78rem;
  font-weight: 700;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: .35rem;
  font-family: inherit;
  text-align: center;
  line-height: 1.25;
}

.cd-quick__item:hover {
  color: var(--qh-red-700);
}

.cd-quick__ico {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  box-shadow: var(--qh-shadow);
}

.cd-quick__ico .material-symbols-outlined {
  font-size: 1.55rem;
}

@media (max-width: 900px) {
  .cd-quick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem .35rem;
    padding: .85rem .65rem;
  }

  .cd-quick__item {
    font-size: .68rem;
    padding: .25rem .15rem;
  }

  .cd-quick__ico {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 12px;
  }

  .cd-quick__ico .material-symbols-outlined {
    font-size: 1.35rem;
  }
}

.cd-quick__ico.is-rules {
  background: #ecfdf5;
  color: #047857;
}

.cd-quick__ico.is-docs {
  background: #eff6ff;
  color: #1d4ed8;
}

.cd-quick__ico.is-ans {
  background: #fff7ed;
  color: #c2410c;
}

.cd-quick__ico.is-res {
  background: #fef2f2;
  color: #991b1b;
}

.cd-quick__ico.is-rank {
  background: #eef2ff;
  color: #4338ca;
}

#cdAnswerModal {
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

#cdAnswerModal[hidden] {
  display: none !important;
}

#cdAnswerModal.is-open {
  opacity: 1;
}

.cd-answer-dialog {
  width: min(100%, 42rem);
  max-height: min(86vh, 760px);
  text-align: left;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.cd-answer-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  border: 0;
  background: var(--qh-zinc-100);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--qh-zinc-700);
}

.cd-answer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.1rem 3rem 0.85rem 1.2rem;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.cd-answer-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--qh-zinc-900);
}

.cd-answer-week {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--qh-zinc-600);
}

.cd-answer-week select {
  border: 1px solid var(--qh-zinc-200);
  border-radius: 8px;
  padding: .25rem .45rem;
  font-weight: 700;
}

.cd-answer-body {
  overflow: auto;
  padding: 1rem 1.2rem 1.25rem;
}

.cd-ans-q {
  padding: .85rem 0;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.cd-ans-q:last-child {
  border-bottom: 0;
}

.cd-ans-q__n {
  margin: 0 0 .25rem;
  font-size: .72rem;
  font-weight: 800;
  color: var(--qh-red-800);
  text-transform: uppercase;
}

.cd-ans-q__t {
  margin: 0 0 .55rem;
  font-weight: 700;
  color: var(--qh-zinc-900);
  line-height: 1.45;
}

.cd-ans-q ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .35rem;
}

.cd-ans-q li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: .45rem;
  align-items: start;
  font-size: .88rem;
  color: var(--qh-zinc-700);
}

.cd-ans-q li.is-correct {
  color: #15803d;
  font-weight: 700;
}

.cd-ans-q li .material-symbols-outlined {
  font-size: 1.15rem;
  color: #16a34a;
}

.cd-ans-dot {
  width: .55rem;
  height: .55rem;
  margin-top: .4rem;
  border-radius: 999px;
  background: var(--qh-zinc-300);
  display: inline-block;
}

@media (max-width: 900px) {
  .cd-layout {
    grid-template-columns: 1fr;
  }

  .cd-aside {
    position: static;
    order: -1;
  }

  .cd-news li {
    grid-template-columns: 1fr;
    gap: .25rem;
  }
}

/* ===== News / materials / content pages ===== */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list__item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--qh-zinc-100);
}

.news-list__item:last-child {
  border-bottom: 0;
}

.news-list__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}

.news-list__meta time {
  font-size: .8rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
}

.news-list__title {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--qh-red-900);
  text-decoration: none;
  margin-bottom: .35rem;
}

.news-list__title:hover {
  color: var(--qh-red-700);
}

.news-list__item p {
  margin: 0 0 .55rem;
  color: var(--qh-zinc-600);
  font-size: .9rem;
  line-height: 1.5;
}

.cd-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--qh-zinc-100);
  font-size: .85rem;
  font-weight: 700;
  color: var(--qh-zinc-600);
}

.qh-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem .65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.qh-pager__btn {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: .45rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--qh-zinc-200);
  background: #fff;
  color: var(--qh-red-800);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}

.qh-pager__btn:hover {
  background: var(--qh-red-50);
  color: var(--qh-red-900);
}

.qh-pager__btn.is-disabled {
  opacity: .45;
  pointer-events: none;
  color: var(--qh-zinc-500);
}

.qh-pager__btn .material-symbols-outlined {
  font-size: 1.15rem;
}

.qh-pager__pages {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.qh-pager__num {
  min-width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 800;
  color: var(--qh-zinc-700);
  text-decoration: none;
  border: 1px solid transparent;
}

a.qh-pager__num:hover {
  background: var(--qh-red-50);
  color: var(--qh-red-800);
  border-color: #fecaca;
}

.qh-pager__num.is-active {
  background: var(--qh-red-700);
  color: #fff;
}

.qh-pager__ellipsis {
  color: var(--qh-zinc-400);
  font-weight: 700;
  padding: 0 .15rem;
}

.qh-pager__meta {
  width: 100%;
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
}

@media (min-width: 720px) {
  .qh-pager__meta {
    width: auto;
    order: 0;
    margin: 0 .25rem;
  }
}

.content-article__body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--qh-zinc-800);
  white-space: pre-wrap;
}

.content-article__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--qh-zinc-100);
}

.mat-list {
  display: grid;
  gap: .65rem;
}

.mat-item {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border: 1px solid var(--qh-zinc-200);
  border-radius: 12px;
  background: #fafafa;
}

.mat-item__main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .65rem;
  align-items: start;
  flex: 1 1 14rem;
  min-width: 0;
}

.mat-item__main>.material-symbols-outlined {
  color: var(--qh-red-800);
  font-size: 1.6rem;
}

.mat-item__main strong {
  display: block;
  color: var(--qh-zinc-900);
  margin-bottom: .2rem;
}

.mat-item__desc {
  font-size: .84rem;
  color: var(--qh-zinc-600);
  line-height: 1.45;
}

.mat-item__desc p {
  margin: 0;
}

.mat-item__file {
  margin-top: .25rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
}

.mat-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  flex-shrink: 0;
}

a.announce-item {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background .12s ease;
  border-radius: 10px;
  padding: .55rem .45rem;
  margin: 0 -.45rem;
}

a.announce-item:hover {
  background: #fafafa;
}

/* ===== Organizer result reports ===== */
.rr-hero__contest {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: .75rem;
  flex-wrap: wrap;
}

.rr-page {
  padding-top: 1.25rem;
}

.rr-summary {
  margin-bottom: 1.25rem;
}

.rr-summary .content-article__body,
.rr-commentary .content-article__body {
  white-space: normal;
}

.rr-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.rr-kpi {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--qh-surface);
  border: 1px solid var(--qh-zinc-100);
  border-radius: var(--qh-radius-lg);
  padding: 1rem 1.05rem;
  box-shadow: var(--qh-shadow);
}

.rr-kpi__ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--qh-red-50);
  color: var(--qh-red-800);
  flex-shrink: 0;
}

.rr-kpi__label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rr-kpi__value {
  display: block;
  margin-top: .2rem;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--qh-red-900);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.rr-kpi__unit {
  margin-left: .25rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--qh-zinc-500);
}

.rr-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.rr-chart {
  padding: 1.1rem 1.15rem 1.25rem;
}

.rr-chart:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.rr-chart__title {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--qh-zinc-900);
}

.rr-chart__canvas-wrap {
  height: 280px;
  position: relative;
}

.rr-chart__canvas-wrap.is-round {
  height: 300px;
  max-width: 360px;
  margin: 0 auto;
}

.rr-commentary {
  margin-bottom: 1.25rem;
}

.rr-commentary .content-article__body h3 {
  margin: 0 0 .65rem;
  font-size: 1.15rem;
  color: var(--qh-red-900);
}

.rr-commentary .content-article__body ul {
  margin: .5rem 0 .85rem 1.1rem;
  padding: 0;
}

.rr-commentary .content-article__body li {
  margin: .35rem 0;
}

.rr-winners {
  padding: 1.1rem 1.15rem 1.25rem;
}

.rr-table-wrap {
  overflow-x: auto;
}

.rr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.rr-table th,
.rr-table td {
  padding: .7rem .65rem;
  border-bottom: 1px solid var(--qh-zinc-100);
  text-align: left;
  vertical-align: top;
}

.rr-table th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--qh-zinc-500);
  background: var(--qh-zinc-50);
}

.rr-award {
  display: inline-block;
  font-weight: 800;
  color: var(--qh-red-800);
  background: var(--qh-red-50);
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .8rem;
}

.rr-score {
  font-weight: 800;
  color: var(--qh-red-900);
}

.news-list__contest {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin: 0 0 .4rem !important;
  font-size: .82rem !important;
  font-weight: 700;
  color: var(--qh-zinc-500) !important;
}

.news-list__contest .material-symbols-outlined {
  font-size: 1rem;
}

@media (max-width: 900px) {
  .rr-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rr-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .rr-kpis {
    grid-template-columns: 1fr;
  }
}