:root {
  --bg: #050505;
  --surface: #0c0d0d;
  --surface-2: #111212;
  --surface-3: #1c1d1d;
  --line: #262727;
  --line-strong: #383a3a;
  --text: #ededed;
  --muted: #858686;
  --gold: #d4ad63;
  --gold-muted: #9f814b;
  --danger: #8f5e56;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(212, 173, 99, 0.48);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.service-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0 24px 12px;
  display: grid;
  grid-template-rows: 82px minmax(0, 1fr);
  overflow: hidden;
}

.service-header {
  min-width: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #111;
}

.header-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-title h1 {
  margin: 0;
  overflow: hidden;
  color: #f4f4f4;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-emblem {
  width: 58px;
  height: 58px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.header-emblem img,
.application-icon img,
.reader-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.back {
  width: 42px;
  height: 42px;
  margin-right: 11px;
  padding: 0 0 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.back:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateX(-2px);
}

.back.hidden {
  display: none;
}

main {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.997);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  pointer-events: none;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.app-grid {
  width: min(100%, 1480px);
  height: auto;
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(460px, 66vh, 680px);
  gap: 24px;
  padding: 26px 0 18px;
}

#launcher {
  overflow: auto;
  scrollbar-color: #4a4c4c transparent;
  scrollbar-width: thin;
}

#launcher::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#launcher::-webkit-scrollbar-track {
  background: transparent;
}

#launcher::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #4a4c4c;
  background-clip: padding-box;
}

.application {
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 34px 28px 30px;
  border: 1px solid #181919;
  border-radius: 14px;
  background: rgba(12, 13, 13, 0.34);
  color: var(--text);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 28px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.application:hover {
  background: var(--surface);
  border-color: #343636;
  transform: translateY(-4px);
}

.application:active {
  transform: translateY(-1px) scale(0.985);
}

.application strong {
  font-size: clamp(21px, 1.45vw, 28px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.application-icon {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.application-icon img {
  display: block;
  width: min(82%, 360px);
  height: min(48vh, 400px);
  opacity: 1;
  filter: none;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.application:hover img {
  transform: scale(1.055);
  filter: drop-shadow(0 8px 14px rgba(255, 190, 35, 0.16));
}

#law {
  overflow: visible;
}

.law-toolbar {
  position: relative;
  z-index: 120;
  height: 66px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto 250px;
  gap: 12px;
  align-items: start;
}

.law-toolbar.no-filter {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.search,
.filter-trigger,
.view-switch {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.search {
  min-width: 0;
  padding: 0 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.search:focus-within {
  border-color: #555858;
  background: #131414;
}

.search-mark {
  width: 13px;
  height: 13px;
  position: relative;
  flex: 0 0 auto;
  border: 1.5px solid #858787;
  border-radius: 50%;
}

.search-mark::after {
  content: "";
  width: 5px;
  height: 1.5px;
  position: absolute;
  right: -4px;
  bottom: -2px;
  background: #858787;
  transform: rotate(-45deg);
  transform-origin: left center;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.search input::placeholder {
  color: #737575;
}

.search input::-webkit-search-cancel-button {
  cursor: pointer;
  filter: grayscale(1) brightness(1.25);
}

.view-switch {
  padding: 4px;
  display: flex;
  align-items: center;
}

.view-switch.disabled {
  opacity: 0.38;
  pointer-events: none;
}

.view-switch button {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #777979;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.view-switch button:hover {
  color: #d5d6d6;
}

.view-switch button.active {
  background: #292a2a;
  color: #f0f0f0;
}

.filter-select {
  position: relative;
  min-width: 0;
}

.filter-select.open {
  z-index: 121;
}

.filter-trigger {
  width: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #b8b9b9;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.filter-trigger:hover {
  border-color: var(--line-strong);
  background: #171818;
}

.filter-select.open .filter-trigger {
  border-color: #777979;
  box-shadow: 0 0 0 2px rgba(180, 180, 180, 0.1);
}

.filter-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.5px solid #8b8d8d;
  border-bottom: 1.5px solid #8b8d8d;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.filter-select.open .filter-chevron {
  transform: translateY(2px) rotate(225deg);
}

.filter-menu {
  width: 100%;
  max-height: 280px;
  position: absolute;
  top: 60px;
  right: 0;
  z-index: 100;
  padding: 5px;
  overflow: auto;
  border: 1px solid #303232;
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.55);
}

.filter-menu button {
  width: 100%;
  min-height: 42px;
  position: relative;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #aeb0b0;
  text-align: left;
  cursor: pointer;
}

.filter-menu button:hover,
.filter-menu button.keyboard-focus {
  background: var(--surface-3);
  color: #fff;
}

.filter-menu button[aria-selected="true"] {
  padding-left: 15px;
  background: #242525;
  color: #fff;
  font-weight: 600;
}

.filter-menu button[aria-selected="true"]::before {
  content: "";
  width: 2px;
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 7px;
  border-radius: 2px;
  background: var(--gold);
}

.filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
}

.mobile-nav {
  display: none;
}

.law-layout {
  height: calc(100% - 66px);
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 360px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  transition: grid-template-columns 0.22s ease;
}

.law-layout.full-view {
  grid-template-columns: 320px minmax(0, 1fr);
}

.law-layout.full-view .contents-panel {
  display: none;
}

.law-layout.search-mode {
  grid-template-columns: 390px minmax(0, 1fr);
}

.law-layout.search-mode .documents-panel {
  display: none;
}

.documents-panel,
.contents-panel,
.reader-panel {
  min-width: 0;
  min-height: 0;
}

.documents-panel,
.contents-panel {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.contents-panel {
  background: #080909;
}

.panel-head {
  min-width: 0;
  padding: 0 23px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.panel-head strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-head > b {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 11px;
}

.document-list,
.contents-list,
.reader-panel {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.document-item,
.chapter-item,
.search-result-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #b4b4b4;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.document-item {
  min-height: 88px;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
}

.document-item:hover,
.chapter-item:hover,
.search-result-item:hover {
  background: #171818;
  color: #fff;
}

.document-item.selected,
.chapter-item.selected,
.search-result-item.selected {
  background: #202121;
  color: #fff;
  box-shadow: inset 3px 0 #8d8d8d;
}

.document-item strong,
.document-item small {
  display: block;
}

.document-item strong {
  font-size: 16px;
  line-height: 1.25;
}

.document-item small {
  margin-top: 7px;
  color: #666868;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.document-item.mandatory strong {
  color: var(--gold);
}

.document-item.mandatory small {
  color: var(--gold-muted);
}

.document-item.mandatory.selected {
  box-shadow: inset 3px 0 var(--gold);
}

.chapter-item {
  min-height: 62px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.chapter-item > span {
  min-width: 25px;
  margin-top: 3px;
  color: #686a6a;
  font-size: 10px;
}

.chapter-item strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.32;
}

.chapter-item.selected strong {
  color: var(--gold);
}

.search-result-item {
  min-height: 104px;
  padding: 15px 18px 16px;
  display: block;
}

.search-result-source,
.search-result-location,
.search-result-copy {
  display: block;
}

.search-result-source {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-result-location {
  margin-bottom: 8px;
  overflow: hidden;
  color: #777979;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy {
  overflow: hidden;
  color: #c7c8c8;
  display: -webkit-box;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.search-result-score {
  margin-top: 9px;
  display: inline-flex;
  color: #676969;
  font-size: 10px;
}

.panel-placeholder {
  padding: 23px;
  color: #666868;
  font-size: 13px;
  line-height: 1.5;
}

.reader-panel {
  position: relative;
  background: #060606;
}

.reader-panel > header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 126px;
  padding: 24px 36px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(10px);
}

.reader-panel > header small {
  display: block;
  margin: 12px 0 7px;
  color: #777979;
}

.reader-panel > header h2 {
  max-width: 980px;
  margin: 0;
  color: #f3f3f3;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
}

.status-badge {
  display: inline-flex;
  padding: 6px 8px;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #8f9090;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.status-badge.mandatory {
  border-color: #725c34;
  background: #1a160f;
  color: var(--gold);
}

.article-text {
  width: min(100%, 1050px);
  padding: 27px 38px 90px;
}

.article-text p {
  max-width: 850px;
  margin: 0 0 16px;
  color: #c8c9c9;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.68;
}

.article-text .law-document-title {
  margin-bottom: 28px;
  color: #eee;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.law-chapter-heading,
.law-chapter-subtitle,
.law-article-heading,
.law-section-heading {
  max-width: 850px;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

.law-chapter-heading {
  margin: 42px 0 12px;
  color: var(--gold);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
}

.law-chapter-heading:first-child {
  margin-top: 4px;
}

.law-chapter-subtitle {
  margin: 0 0 27px;
  color: #e3e3e3;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

.law-article-heading {
  margin: 32px 0 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid #242525;
  color: #f0f0f0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.law-section-heading {
  margin: 29px 0 13px;
  color: #e6e6e6;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

.article-text .law-article-clause,
.article-text .law-numbered-clause {
  margin-bottom: 18px;
  color: #c8c9c9;
  font-weight: 400;
}

.law-clause-number {
  color: #e4e4e4;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-weight: 600;
}

.article-text .law-list-item {
  position: relative;
  padding-left: 22px;
  color: #d4d4d4;
}

.article-text .law-note,
.article-text .law-exception {
  max-width: 850px;
  margin: 23px 0;
  padding: 15px 17px;
  border-left: 3px solid;
  border-radius: 0 5px 5px 0;
  background: var(--surface-2);
  font-family: Arial, sans-serif;
}

.article-text .law-note {
  border-color: #b18d4c;
  color: #dcc28d;
}

.article-text .law-exception {
  border-color: var(--danger);
  background: #15100f;
  color: #d5aaa2;
}

.structured-law-text {
  width: min(100%, 1120px);
  padding-top: 18px;
}

.law-structured-chapter {
  max-width: 940px;
  padding: 8px 0 34px;
}

.law-structured-chapter.has-divider {
  margin-bottom: 30px;
  border-bottom: 1px solid #252626;
}

.law-structured-chapter-heading {
  margin: 8px 0 30px;
  display: grid;
  gap: 7px;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}

.law-structured-chapter-marker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.law-structured-chapter-title {
  color: #efefef;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.law-preamble-title {
  max-width: 900px;
  margin: 6px 0 18px;
  color: var(--gold);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.law-node {
  max-width: 900px;
}

.law-node-article,
.law-node-part {
  margin: 22px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid #242525;
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.law-node-part {
  margin-top: 14px;
  padding-top: 14px;
  border-top-color: #181919;
}

.law-node-marker {
  padding-top: 2px;
  color: var(--gold);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.article-text .law-node-copy {
  max-width: 760px;
  margin: 0;
  color: #d0d1d1;
  font-weight: 400;
  line-height: 1.65;
}

.law-node-point,
.law-node-subpoint {
  margin: 11px 0 0 142px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.law-node-subpoint {
  margin-left: 176px;
  grid-template-columns: 30px minmax(0, 1fr);
}

.law-node-list-marker {
  padding-top: 3px;
  color: #929595;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.article-text .law-node-paragraph {
  max-width: 760px;
  margin: 13px 0 0 142px;
}

.article-text .law-node-paragraph.chapter-intro {
  max-width: 900px;
  margin: 0 0 17px;
  color: #bdbebe;
}

.law-node-note,
.law-node-exception {
  max-width: 760px;
  margin: 20px 0 20px 142px;
  padding: 15px 17px;
  border-left: 3px solid;
  border-radius: 0 5px 5px 0;
  background: var(--surface-2);
}

.law-node-note {
  border-color: #b18d4c;
  color: #dcc28d;
}

.law-node-exception {
  border-color: var(--danger);
  background: #15100f;
  color: #d5aaa2;
}

.law-node-note > strong,
.law-node-exception > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.article-text .law-node-note > p,
.article-text .law-node-exception > p {
  margin: 0;
  color: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.search-keyword {
  padding: 1px 3px;
  border-radius: 3px;
  background: #3a2d15;
  color: #f3c86e;
  font-weight: 700;
}

.search-target {
  scroll-margin-top: 155px;
  animation: target-pulse 0.9s ease-out;
}

@keyframes target-pulse {
  0% { background-color: rgba(212, 173, 99, 0.18); }
  100% { background-color: transparent; }
}

.reader-empty {
  min-height: 100%;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.reader-emblem {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
}

.reader-empty h2 {
  margin: 20px 0 8px;
  font-size: 24px;
}

.reader-empty p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

#training {
  overflow: hidden;
  display: grid;
  grid-template-rows: 74px 66px minmax(0, 1fr);
}

.training-mode-switch {
  min-width: 0;
  padding: 10px 0 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.training-mode-switch button {
  position: relative;
  min-width: 0;
  padding: 9px 92px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 3px;
  background: #0d0e0e;
  color: #a9abab;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.training-mode-switch button:hover {
  border-color: #3b3d3d;
  background: #131414;
  color: #f0f0f0;
}

.training-mode-switch button[aria-selected="true"] {
  border-color: #715b34;
  background: #18140e;
  color: #e4c47f;
  box-shadow: inset 3px 0 var(--gold);
}

.training-mode-switch span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-mode-switch small {
  overflow: hidden;
  color: #737575;
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-mode-switch b {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 5px 7px;
  border: 1px solid #353737;
  border-radius: 4px;
  color: #777979;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transform: translateY(-50%);
}

.training-toolbar {
  height: 66px;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(180px, 420px) auto;
  align-items: start;
  gap: 20px;
}

.training-progress-copy {
  height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.training-progress-copy span,
.training-course-head > span,
.training-lesson-head > span,
.training-overview-mark {
  color: var(--gold-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.training-progress-copy strong {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 600;
}

#trainingProgress {
  width: 100%;
  height: 7px;
  margin-top: 23px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #1b1c1c;
  accent-color: var(--gold);
}

#trainingProgress::-webkit-progress-bar {
  border-radius: 999px;
  background: #1b1c1c;
}

#trainingProgress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #987641, var(--gold));
}

#trainingProgress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #987641, var(--gold));
}

.training-continue {
  min-width: 160px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid #68542f;
  border-radius: 6px;
  background: #17130d;
  color: #e2c17e;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.training-continue:hover {
  border-color: #9a7a42;
  background: #211a10;
  transform: translateY(-1px);
}

.training-continue:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}

.training-layout {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}

.training-catalog {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.training-catalog-list,
.training-reader {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.training-course-head {
  padding: 22px 22px 17px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.training-course-head h2 {
  margin: 0;
  color: #efefef;
  font-size: 17px;
  line-height: 1.25;
}

.training-course-head small {
  color: #6f7171;
  font-size: 11px;
}

.training-lesson-item {
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  background: transparent;
  color: #bfc0c0;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.training-lesson-item:hover {
  background: #171818;
  color: #fff;
}

.training-lesson-item.selected {
  background: #202121;
  color: #fff;
  box-shadow: inset 3px 0 var(--gold);
}

.training-lesson-number {
  padding-top: 2px;
  color: var(--gold-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.training-lesson-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.training-lesson-item strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.28;
}

.training-lesson-item small {
  overflow: hidden;
  color: #757777;
  display: -webkit-box;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.training-lesson-item > b {
  padding-top: 2px;
  color: #6e7070;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
}

.training-lesson-item.completed > b {
  color: var(--gold);
}

.training-catalog-empty {
  padding: 22px;
  color: var(--muted);
}

.training-reader {
  background: #060606;
}

.training-overview {
  width: min(100%, 780px);
  min-height: 100%;
  padding: 72px clamp(30px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.training-overview h2 {
  max-width: 650px;
  margin: 13px 0 16px;
  color: #f2f2f2;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.08;
}

.training-overview > p {
  max-width: 680px;
  margin: 0;
  color: #a9aaaa;
  font-family: Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.training-overview-facts {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.training-overview-facts span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #9b9d9d;
  font-size: 12px;
}

.training-safety-note {
  max-width: 680px;
  margin-top: 32px;
  padding: 17px 19px;
  border-left: 3px solid var(--gold-muted);
  border-radius: 0 6px 6px 0;
  background: #11100d;
  color: #c9b78f;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.training-lesson {
  width: min(100%, 990px);
  padding: 0 42px 70px;
}

.training-lesson-head {
  padding: 32px 0 27px;
  border-bottom: 1px solid var(--line);
}

.training-lesson-head h2 {
  margin: 9px 0 11px;
  color: #f3f3f3;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
}

.training-lesson-head > p {
  max-width: 760px;
  margin: 0;
  color: #b9bbbb;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.training-lesson-meta {
  margin-top: 15px;
  color: #6c6e6e;
  font-size: 11px;
}

.lesson-block {
  max-width: 850px;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid #242626;
  border-radius: 7px;
  background: #0c0d0d;
}

.lesson-block h3 {
  margin: 0 0 11px;
  color: #ececec;
  font-size: 18px;
  font-weight: 600;
}

.lesson-block > p,
.lesson-list li > div > span {
  color: #c4c5c5;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.62;
}

.lesson-block > p {
  margin: 0;
}

.lesson-block-danger,
.lesson-block-consequence {
  border-color: #4c302d;
  border-left: 3px solid #9c5d53;
  background: #120d0c;
}

.lesson-block-danger h3,
.lesson-block-consequence h3 {
  color: #d7a29a;
}

.lesson-block-gap {
  border-color: #554629;
  border-left: 3px solid var(--gold);
  background: #14120d;
}

.lesson-block-visual {
  border-color: rgba(89, 127, 174, 0.36);
  background: #0b0d10;
}

.training-visual {
  margin: 18px 0 0;
}

.training-visual-link {
  display: block;
  overflow: hidden;
  border: 1px solid #30343a;
  border-radius: 7px;
  background: #f5f5f5;
  cursor: zoom-in;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.training-visual-link:hover {
  border-color: var(--gold-muted);
  transform: translateY(-2px);
}

.training-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.training-visual figcaption {
  margin-top: 10px;
  color: #808383;
  font-size: 12px;
  line-height: 1.5;
}

.lesson-block-gap h3 {
  color: #e1c17e;
}

.lesson-block-summary,
.lesson-block-lead {
  border-color: #3a3b3b;
  background: #111212;
}

.lesson-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: lesson-step;
}

.lesson-list li {
  position: relative;
  padding: 15px 0 15px 38px;
  border-top: 1px solid #242626;
}

.lesson-list li::before {
  content: "•";
  position: absolute;
  top: 15px;
  left: 7px;
  color: var(--gold);
  font-weight: 700;
}

.lesson-list-steps li {
  counter-increment: lesson-step;
}

.lesson-list-steps li::before {
  content: counter(lesson-step, decimal-leading-zero);
  left: 0;
  color: var(--gold-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.lesson-list li > div {
  display: grid;
  gap: 5px;
}

.lesson-list li > div > strong {
  color: #ededed;
  font-size: 14px;
  font-weight: 600;
}

.training-sources {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.training-sources.compact {
  margin-top: 9px;
}

.training-source {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #3c3527;
  border-radius: 4px;
  background: #15130e;
  color: #c4a76c;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.training-source:hover {
  border-color: #80673a;
  background: #1d180f;
  color: #e1c17f;
}

.training-source.compact {
  min-height: 30px;
  padding: 5px 8px;
  color: #99917f;
  font-size: 10px;
}

.training-lesson-actions {
  max-width: 850px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
}

.training-lesson-actions button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: #bfc0c0;
  cursor: pointer;
}

.training-lesson-actions button:last-child {
  justify-self: end;
}

.training-lesson-actions .complete-lesson {
  border-color: #725c34;
  background: #17130d;
  color: #dec07f;
}

.training-lesson-actions button:disabled {
  opacity: 0.4;
  cursor: default;
}

.scroll-region,
.filter-menu {
  scrollbar-width: thin;
  scrollbar-color: #404242 #090a0a;
}

.scroll-region::-webkit-scrollbar,
.filter-menu::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.scroll-region::-webkit-scrollbar-track,
.filter-menu::-webkit-scrollbar-track {
  background: #090a0a;
}

.scroll-region::-webkit-scrollbar-thumb,
.filter-menu::-webkit-scrollbar-thumb {
  min-height: 38px;
  border: 2px solid #090a0a;
  border-radius: 999px;
  background: #404242;
  background-clip: padding-box;
}

.scroll-region::-webkit-scrollbar-thumb:hover,
.filter-menu::-webkit-scrollbar-thumb:hover {
  background: #595c5c;
  background-clip: padding-box;
}

.scroll-region::-webkit-scrollbar-thumb:active,
.filter-menu::-webkit-scrollbar-thumb:active {
  background: #707474;
  background-clip: padding-box;
}

.scroll-region::-webkit-scrollbar-button,
.filter-menu::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

.scroll-region::-webkit-scrollbar-corner,
.filter-menu::-webkit-scrollbar-corner {
  background: #090a0a;
}

@media (max-width: 1120px) {
  .law-layout {
    grid-template-columns: 270px 310px minmax(0, 1fr);
  }

  .law-layout.full-view {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .law-layout.search-mode {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .reader-panel > header {
    padding-inline: 28px;
  }

  .article-text {
    padding-inline: 30px;
  }

  .training-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .service-shell {
    padding: 0 12px 8px;
    grid-template-rows: 68px minmax(0, 1fr);
  }

  .header-title {
    width: 100%;
  }

  .header-title h1 {
    font-size: 23px;
  }

  .header-emblem {
    width: 45px;
    height: 45px;
  }

  .back {
    width: 38px;
    height: 38px;
    margin-right: 4px;
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: 218px;
    height: auto;
    gap: 12px;
    padding: 20px 0 30px;
  }

  .application {
    height: 218px;
    padding: 18px 12px 16px;
    gap: 14px;
  }

  .application-icon img {
    width: min(92%, 150px);
    height: 142px;
  }

  .application strong {
    font-size: 17px;
  }

  .law-toolbar {
    height: 112px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "search search"
      "view filter";
    gap: 8px;
  }

  .law-toolbar.no-filter {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "search"
      "view";
  }

  .search {
    grid-area: search;
  }

  .view-switch {
    grid-area: view;
  }

  .filter-select {
    grid-area: filter;
  }

  .search,
  .filter-trigger,
  .view-switch {
    height: 48px;
  }

  .view-switch {
    justify-content: stretch;
  }

  .view-switch button {
    min-width: 0;
    flex: 1 1 50%;
    padding-inline: 5px;
  }

  .filter-menu {
    width: auto;
    max-height: min(60dvh, 420px);
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 110;
    padding: 7px;
    border-radius: 10px;
  }

  .filter-menu button {
    min-height: 48px;
  }

  .mobile-nav {
    height: 42px;
    padding: 4px;
    display: flex;
    gap: 4px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    background: var(--surface);
  }

  .mobile-nav button {
    min-width: 0;
    flex: 1 1 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #777979;
    font-size: 12px;
  }

  .mobile-nav button.active {
    background: #252626;
    color: #fff;
  }

  .mobile-nav button:disabled {
    opacity: 0.34;
  }

  .law-layout,
  .law-layout.full-view,
  .law-layout.search-mode {
    height: calc(100% - 154px);
    position: relative;
    display: block;
    border-radius: 0 0 7px 7px;
  }

  .documents-panel,
  .contents-panel,
  .reader-panel,
  .law-layout.full-view .contents-panel,
  .law-layout.search-mode .documents-panel {
    position: absolute;
    inset: 0;
    display: none;
    border-right: 0;
  }

  .law-layout[data-mobile-pane="documents"] .documents-panel,
  .law-layout[data-mobile-pane="contents"] .contents-panel,
  .law-layout[data-mobile-pane="reader"] .reader-panel {
    display: grid;
  }

  .law-layout[data-mobile-pane="reader"] .reader-panel {
    display: block;
  }

  .law-layout.search-mode[data-mobile-pane="contents"] .contents-panel,
  .law-layout.search-mode[data-mobile-pane="reader"] .reader-panel {
    display: grid;
  }

  .law-layout.search-mode[data-mobile-pane="reader"] .reader-panel {
    display: block;
  }

  .panel-head {
    height: 64px;
    padding-inline: 18px;
  }

  .document-item {
    min-height: 78px;
    padding: 16px 18px;
  }

  .reader-panel > header {
    min-height: 112px;
    padding: 18px 19px 16px;
  }

  .reader-panel > header h2 {
    font-size: 21px;
  }

  .article-text {
    padding: 21px 19px 70px;
  }

  .article-text p {
    font-size: 16px;
    line-height: 1.62;
  }

  .law-chapter-heading {
    font-size: 21px;
  }

  .law-article-heading,
  .law-section-heading {
    font-size: 18px;
  }

  .law-structured-chapter-title {
    font-size: 21px;
  }

  .law-node-article,
  .law-node-part {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .law-node-point,
  .law-node-subpoint {
    margin-left: 0;
  }

  .article-text .law-node-paragraph,
  .law-node-note,
  .law-node-exception {
    margin-left: 0;
  }

  .search-target {
    scroll-margin-top: 135px;
  }

  .scroll-region::-webkit-scrollbar {
    width: 7px;
    height: 7px;
  }

  .training-toolbar {
    height: 96px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "copy action"
      "progress progress";
    gap: 5px 12px;
    align-items: center;
  }

  .training-progress-copy {
    grid-area: copy;
    height: 48px;
  }

  #trainingProgress {
    grid-area: progress;
    height: 6px;
    margin: 0 0 10px;
  }

  .training-continue {
    grid-area: action;
    min-width: 128px;
    height: 44px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .training-layout {
    height: auto;
    position: relative;
    display: block;
    border-radius: 0 0 7px 7px;
  }

  .training-catalog,
  .training-reader {
    position: absolute;
    inset: 0;
    display: none;
    border-right: 0;
  }

  .training-layout[data-mobile-pane="catalog"] .training-catalog {
    display: grid;
  }

  .training-layout[data-mobile-pane="lesson"] .training-reader {
    display: block;
  }

  .training-overview {
    padding: 38px 22px 60px;
  }

  .training-overview h2 {
    font-size: 29px;
  }

  .training-lesson {
    padding: 0 18px 55px;
  }

  .training-lesson-head {
    padding: 24px 0 22px;
  }

  .training-lesson-head h2 {
    font-size: 25px;
  }

  .lesson-block {
    margin-top: 20px;
    padding: 18px;
  }

  .training-source {
    min-height: 44px;
  }

  .training-source.compact {
    min-height: 40px;
  }

  .training-lesson-actions {
    grid-template-columns: 1fr 1fr;
  }

  .training-lesson-actions .complete-lesson {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .training-lesson-actions button:last-child {
    justify-self: stretch;
  }

  #training {
    grid-template-rows: 108px 96px 42px minmax(0, 1fr);
  }

  .training-mode-switch {
    padding: 8px 0;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .training-mode-switch button {
    min-height: 43px;
    padding: 7px 82px 7px 12px;
  }

  .training-mode-switch small {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
