:root {
  --bg: #0b0d10;
  --surface: #111418;
  --surface-2: #161a1f;
  --surface-3: #1c2127;
  --line: #272d35;
  --line-strong: #353d47;
  --text: #f5f7f9;
  --muted: #9ca5af;
  --muted-2: #737d88;
  --white: #ffffff;
  --danger: #ff7f7f;
  --success: #b9f5c5;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --max: 1180px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Huninn", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.96);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--white);
  font-size: 19px;
}

.brand-seal img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-link i {
  font-size: 15px;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--white);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.site-main {
  width: min(var(--max), calc(100% - 40px));
  min-height: calc(100vh - 148px);
  margin: 0 auto;
  padding: 42px 0 70px;
}

.page-view {
  animation: pageIn 180ms ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow i {
  color: var(--text);
}

.hero-panel {
  min-height: 410px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  gap: 36px;
  align-items: stretch;
  padding: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: center;
  max-width: 700px;
}

.hero-copy h1 {
  margin: 14px 0 16px;
  max-width: 650px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero-copy > p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.refresh-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.primary-button {
  border: 1px solid var(--white);
  background: var(--white);
  color: #0b0d10;
}

.primary-button:hover {
  background: #e9edf0;
}

.secondary-button,
.refresh-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.secondary-button:hover,
.refresh-button:hover {
  background: var(--surface-3);
}

.primary-button:active,
.secondary-button:active,
.refresh-button:active {
  transform: scale(0.985);
}

.primary-button:disabled,
.secondary-button:disabled,
.refresh-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.compact {
  min-height: 46px;
}

.hero-mark {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--muted);
}

.hero-mark-ring {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--white);
  font-size: 44px;
}

.hero-mark small {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.portal-strip button {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 19px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.portal-strip button:last-child {
  border-right: 0;
}

.portal-strip button:hover {
  background: var(--surface-2);
}

.portal-strip button > i:first-child {
  color: var(--white);
  font-size: 18px;
}

.portal-strip button > i:last-child {
  color: var(--muted-2);
}

.portal-strip button span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.portal-strip b {
  font-size: 14px;
}

.portal-strip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-section-heading,
.news-list-heading,
.rules-toolbar,
.rules-reference-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 18px;
}

.home-section-heading h2,
.news-list-heading h2,
.rules-toolbar h2,
.rules-reference-heading h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.service-card {
  display: flex;
  flex-direction: column;
  min-height: 245px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.service-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 19px;
}

.service-card h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.service-card button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 18px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.portal-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.portal-note > i {
  margin-top: 2px;
  color: var(--text);
}

.portal-note div {
  display: grid;
  gap: 3px;
  line-height: 1.5;
}

.portal-note b {
  color: var(--text);
}

.page-heading-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 136px;
  padding: 26px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
}

.section-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 22px;
}

.page-heading-copy {
  min-width: 0;
}

.page-heading-panel h1 {
  margin: 5px 0 6px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.035em;
}

.page-heading-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.news-heading-panel .refresh-button {
  margin-left: auto;
  flex: 0 0 auto;
}

.news-status {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.news-featured {
  margin-top: 20px;
}

.featured-article {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
}

.featured-media {
  min-height: 350px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}

.featured-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-placeholder,
.news-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: var(--surface-2);
  font-size: 36px;
}

.featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.news-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.featured-body h2 {
  margin: 16px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.featured-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.news-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.news-list-heading {
  margin-top: 36px;
}

.news-list-heading > div > span,
.rules-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-count,
.rules-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.news-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.news-image-wrap {
  height: 190px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.news-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.news-card:hover .news-image-wrap img {
  transform: scale(1.025);
}

.news-card-body {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 20px;
}

.news-card h3 {
  margin: 13px 0 8px;
  font-size: 19px;
  line-height: 1.2;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.news-card .news-open {
  margin-top: auto;
  padding-top: 20px;
}

.rules-toolbar {
  margin-top: 32px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rule-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.rule-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.rule-card h3 {
  margin: 2px 0 7px;
  font-size: 17px;
}

.rule-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rules-reference-heading {
  margin-top: 42px;
}

.rules-accordion {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
}

.rules-accordion summary {
  min-height: 84px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
}

.rules-accordion summary::-webkit-details-marker {
  display: none;
}

.rules-accordion summary:hover {
  background: var(--surface-2);
}

.accordion-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 18px;
}

.accordion-copy {
  display: grid;
  gap: 4px;
}

.accordion-copy strong {
  font-size: 16px;
}

.accordion-copy small {
  color: var(--muted);
}

.accordion-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.accordion-arrow {
  transition: transform 160ms ease;
}

.rules-accordion[open] .accordion-arrow {
  transform: rotate(180deg);
}

.radio-codes-wrap {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.radio-codes-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.45;
}

.radio-codes-intro i {
  color: var(--text);
  margin-top: 2px;
}

.radio-codes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.radio-code {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 45px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.radio-code b {
  color: var(--white);
  font-size: 12px;
}

.radio-code span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.disclaimer {
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.tests-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.tests-aside {
  position: sticky;
  top: 96px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.aside-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}

.tests-aside h3 {
  margin: 20px 0 8px;
}

.tests-aside > p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.aside-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.aside-row i {
  color: var(--text);
}

.tests-main {
  min-width: 0;
}

.card {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
}

.entry-card {
  padding: 28px;
}

.stack {
  display: grid;
  gap: 13px;
}

.form-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 10px;
}

.form-heading-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
}

.form-heading h2 {
  margin: 0 0 3px;
  font-size: 20px;
}

.form-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stack > label,
.question-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--muted);
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: #0d1013;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-wrap input[type="text"] {
  height: 50px;
  padding: 0 14px 0 44px;
}

.question input[type="text"] {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.55;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #66717d;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: #626b75;
}

.message,
.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.test-card {
  padding: 28px;
}

.test-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.role-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 21px;
}

.test-header-copy h2 {
  margin: 4px 0 7px;
  font-size: 25px;
}

.retake-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.retake-badge.one-time {
  color: var(--text);
}

.test-description {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.55;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.question-title {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.required-mark {
  color: var(--danger);
}

.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.option {
  position: relative;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option span {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0d1013;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.option:hover span {
  color: var(--text);
  background: var(--surface-3);
}

.option input:checked + span {
  border-color: var(--white);
  background: var(--white);
  color: #0b0d10;
}

.submit-row {
  display: grid;
  gap: 9px;
  margin-top: 7px;
}

.result-card {
  padding: 44px 28px;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--success);
  font-size: 25px;
}

.result-card h2 {
  margin: 19px 0 7px;
}

.result-card p {
  max-width: 520px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.site-footer a:hover {
  color: var(--text);
}

.news-dialog {
  width: min(820px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58);
}

.news-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

.dialog-close {
  position: sticky;
  top: 12px;
  z-index: 3;
  float: right;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 12px 12px -52px 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(17, 20, 24, 0.94);
  color: var(--text);
  cursor: pointer;
}

.dialog-image {
  width: 100%;
  max-height: 420px;
  display: block;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.dialog-body {
  padding: 30px;
}

.dialog-body h2 {
  margin: 14px 0 18px;
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.dialog-content {
  color: #c3cad1;
  line-height: 1.75;
  white-space: pre-wrap;
}

@media (max-width: 960px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    min-height: 210px;
  }

  .featured-article {
    grid-template-columns: 1fr;
  }

  .featured-media {
    min-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .radio-codes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tests-layout {
    grid-template-columns: 1fr;
  }

  .tests-aside {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 84px;
  }

  .site-header {
    position: relative;
    height: 70px;
  }

  .header-inner {
    width: min(100% - 28px, var(--max));
    justify-content: flex-start;
  }

  .brand-seal {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .main-nav {
    position: fixed;
    z-index: 100;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 64px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 17px;
    background: rgba(17, 20, 24, 0.97);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
  }

  .nav-link {
    min-width: 0;
    height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 4px;
    border-radius: 12px;
    font-size: 10px;
  }

  .nav-link i {
    font-size: 17px;
  }

  .nav-link.active {
    border-color: var(--line-strong);
    background: var(--surface-3);
  }

  .site-main {
    width: min(100% - 28px, var(--max));
    padding: 24px 0 38px;
  }

  .hero-panel {
    min-height: auto;
    padding: 25px;
    border-radius: 18px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 52px);
  }

  .hero-copy > p {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions button {
    width: 100%;
  }

  .hero-mark {
    min-height: 180px;
  }

  .hero-mark-ring {
    width: 92px;
    height: 92px;
    font-size: 35px;
  }

  .portal-strip {
    grid-template-columns: 1fr;
  }

  .portal-strip button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .portal-strip button:last-child {
    border-bottom: 0;
  }

  .service-grid,
  .news-grid,
  .rules-grid,
  .radio-codes-grid {
    grid-template-columns: 1fr;
  }

  .home-section-heading,
  .news-list-heading,
  .rules-toolbar,
  .rules-reference-heading {
    margin-top: 34px;
  }

  .page-heading-panel {
    align-items: flex-start;
    padding: 21px;
  }

  .section-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .news-heading-panel {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .news-heading-panel .refresh-button {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }

  .featured-article {
    min-height: auto;
  }

  .featured-media {
    min-height: 230px;
  }

  .featured-body {
    padding: 22px;
  }

  .featured-body h2 {
    font-size: 30px;
  }

  .news-image-wrap {
    height: 210px;
  }

  .rules-toolbar,
  .news-list-heading {
    align-items: center;
  }

  .rules-accordion summary {
    grid-template-columns: 44px minmax(0, 1fr) 22px;
    padding: 15px;
  }

  .accordion-action {
    font-size: 0;
  }

  .accordion-action i {
    font-size: 16px;
  }

  .radio-codes-wrap {
    padding: 0 14px 14px;
  }

  .radio-code {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .tests-aside {
    display: none;
  }

  .entry-card,
  .test-card {
    padding: 20px;
  }

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

  .question {
    padding: 15px;
  }

  .site-footer {
    width: min(100% - 28px, var(--max));
    padding: 18px 0 8px;
  }

  .dialog-body {
    padding: 22px;
  }
}

@media (max-width: 420px) {
  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    font-size: 11px;
  }

  .main-nav {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .site-main {
    width: min(100% - 20px, var(--max));
  }

  .hero-panel,
  .page-heading-panel {
    border-radius: 15px;
  }

  .page-heading-panel {
    gap: 13px;
  }

  .page-heading-panel h1 {
    font-size: 29px;
  }

  .rule-card {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 17px;
  }

  .rule-number {
    width: 38px;
    height: 38px;
  }
}


.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-dock {
  display: none;
}

.home-hero {
  min-height: 350px;
  grid-template-columns: 1fr;
}

.home-hero .hero-copy {
  max-width: 820px;
}

.home-news-section {
  scroll-margin-top: 96px;
}

.news-home-heading {
  align-items: end;
  gap: 24px;
}

.news-home-heading > div > p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.home-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-news-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease;
}

.home-news-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.home-news-media {
  width: 100%;
  height: 190px;
  display: block;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
}

.home-news-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.news-title-placeholder,
.article-title-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
}

.news-title-placeholder span {
  max-width: 320px;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.home-news-card-body {
  padding: 19px;
}

.home-news-card-body h3 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.15;
}

.home-news-card-body p {
  min-height: 74px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.article-page-shell {
  max-width: 980px;
  margin: 0 auto;
}

.article-back {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.article-back:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.article-hero {
  height: min(48vw, 520px);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface-2);
}

.article-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.article-title-placeholder span {
  max-width: 720px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.article-reading-wrap {
  max-width: 790px;
  margin: 0 auto;
  padding: 42px 10px 10px;
}

.article-meta {
  margin-bottom: 14px;
}

.article-reading-wrap h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.article-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.article-content {
  color: #cbd2d9;
  font-size: 18px;
  line-height: 1.85;
  white-space: pre-wrap;
}

@media (max-width: 960px) {
  .home-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-dock {
    position: fixed !important;
    z-index: 9999 !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    height: 66px;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    margin: 0 !important;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(17, 20, 24, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(16px);
  }

  .dock-link {
    min-width: 0;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
  }

  .dock-link i {
    font-size: 18px;
  }

  .dock-link.active {
    border-color: var(--line-strong);
    background: var(--surface-3);
    color: var(--white);
  }

  .home-hero {
    min-height: auto;
  }

  .home-news-grid {
    grid-template-columns: 1fr;
  }

  .news-home-heading {
    align-items: stretch;
  }

  .news-home-heading .refresh-button {
    width: 100%;
  }

  .home-news-media {
    height: 220px;
  }

  .home-news-card-body p {
    min-height: 0;
  }

  .article-hero {
    height: 58vw;
    min-height: 235px;
    border-radius: 16px;
  }

  .article-reading-wrap {
    padding: 28px 4px 8px;
  }

  .article-content {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .mobile-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  .article-title-placeholder span {
    font-size: 34px;
  }
}

.discord-mini-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 18px calc(92px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.52);
}

.discord-mini-panel {
  width: min(430px, 100%);
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #111418;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.discord-mini-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.discord-mini-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 20px;
}

.discord-mini-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discord-mini-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.15;
}

.discord-mini-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.discord-mini-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.discord-mini-panel > p {
  margin: 16px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.discord-join-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--white);
  border-radius: 11px;
  background: var(--white);
  color: #0b0d10;
  font-weight: 700;
  text-decoration: none;
}

.discord-join-button:hover {
  background: #e9edf0;
}

.dock-link.discord-open {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--white);
}

@media (max-width: 720px) {
  .mobile-dock {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .discord-mini-backdrop {
    display: flex;
  }
}

@media (min-width: 721px) {
  .discord-mini-backdrop {
    display: none !important;
  }
}
