* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  accent-color: #444;
}

#site-nav {
  background: #eef1f6;
  border-bottom: 1px solid #d8dde6;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
}

.nav-subtitle {
  padding: 4px 24px 10px;
  font-size: 13px;
  color: #666;
}

.nav-brand {
  font-weight: 700;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon {
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  color: #555;
  transition: background 0.15s;
}

.nav-links a:hover {
  background: #f0f0f0;
  color: #222;
}

.nav-links a.nav-active {
  background: #333;
  color: #fff;
}

#site-footer {
  text-align: center;
  padding: 20px 24px;
  background: #eef1f6;
  border-top: 1px solid #d8dde6;
  margin-top: auto;
}

.footer-brand img,
.madji-img-footer {
  max-height: 48px;
  width: auto;
  display: block;
  margin: 0 auto 8px;
  opacity: 0.85;
}

.footer-copy {
  font-size: 12px;
  color: #999;
  margin: 0;
}

.footer-brand {
  font-size: 13px;
  color: #888;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 16px 24px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: #888;
  text-decoration: none;
  margin-bottom: 6px;
}

.back-link:hover {
  color: #333;
}

.header-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
}

#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  display: none;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#scroll-top:hover {
  background: #111;
}

header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

header p {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 16px 24px 0;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  color: #888;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: #444;
}

.tab-btn.active {
  color: #222;
  font-weight: 600;
  border-bottom: 3px solid #333;
}

.content {
  background: #fff;
  margin: 0 24px 24px;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 24px;
  min-height: 400px;
}

.question-block {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eee;
}

.question-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.question-number {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.question-text {
  font-weight: 600;
  margin-bottom: 12px;
  color: #222;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #eee;
  background: #fafafa;
}

.answer-item.correct {
  background: #eafaf1;
  border-color: #a3d9b1;
  color: #1a7a3a;
  font-weight: 500;
}

.answer-item input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #2e7d32;
}

.accordion {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f9f9f9;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

.accordion-header:hover {
  background: #f0f0f0;
}

.accordion-icon {
  font-size: 12px;
  color: #888;
}

.accordion-body {
  display: none;
  padding: 20px;
  border-top: 1px solid #eee;
}

.accordion-body.open {
  display: block;
}

.test-menu {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.menu-card {
  flex: 1;
  min-width: 180px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px 20px;
  cursor: pointer;
  background: #fafafa;
  transition: background 0.15s, border-color 0.15s;
}

.menu-card:hover {
  background: #f0f0f0;
  border-color: #bbb;
}

.menu-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #333;
}

.menu-card p {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.menu-card .meta {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

.timer-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 10px 0 20px;
  font-size: 14px;
  color: #555;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.timer-value {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  font-variant-numeric: tabular-nums;
}

.timer-warning {
  color: #c0392b;
}

.answer-item.wrong {
  background: #fdecea;
  border-color: #e8b4b0;
  color: #c0392b;
}

.q-correct .question-number {
  color: #1a7a3a;
}

.q-wrong .question-number {
  color: #c0392b;
}

.submit-area {
  padding: 24px 0 8px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.submit-btn {
  padding: 12px 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}

.submit-btn:hover {
  background: #111;
}

.submit-btn.secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.submit-btn.secondary:hover {
  background: #f0f0f0;
}

.result-banner {
  text-align: center;
  padding: 32px;
  border-radius: 8px;
  margin-bottom: 32px;
}

.result-banner.success {
  background: #eafaf1;
  border: 1px solid #a3d9b1;
}

.result-banner.fail {
  background: #fdecea;
  border: 1px solid #e8b4b0;
}

.result-title {
  font-size: 36px;
  font-weight: 700;
  color: #333;
}

.result-sub {
  font-size: 16px;
  color: #666;
  margin-top: 8px;
}

label.answer-item {
  cursor: pointer;
}

label.answer-item:hover {
  background: #f0f0f0;
}

.placeholder {
  color: #aaa;
  font-style: italic;
  padding: 40px 0;
  text-align: center;
}

.info-block h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #333;
}

.info-block > p {
  color: #555;
  margin-bottom: 24px;
}

.info-part {
  border-left: 3px solid #ccc;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fafafa;
  border-radius: 0 6px 6px 0;
}

.info-part h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: #333;
}

.info-part p {
  color: #555;
  font-size: 14px;
}

.info-block.hidden {
  display: none;
}

.info-sub {
  margin-top: 8px;
  color: #555;
  font-size: 14px;
}

a.tab-btn {
  text-decoration: none;
}

/* Part 2 — study table */
.address-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.address-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #ddd;
  color: #555;
  font-weight: 600;
}

.address-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.address-table td:first-child {
  width: 55%;
}

.address-table tr:last-child td {
  border-bottom: none;
}

.address-table tr:hover td {
  background: #f9f9f9;
}

/* Part 3 — study routes */
.route-row {
  display: flex;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.route-row:last-child {
  border-bottom: none;
}

.route-endpoints {
  flex: 0 0 280px;
  font-size: 14px;
  line-height: 1.7;
}

.route-note {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.route-streets {
  flex: 1;
  font-size: 14px;
  color: #444;
  line-height: 1.7;
}

/* Part 2 — test input */
.address-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  margin-top: 8px;
  outline: none;
  transition: border-color 0.15s;
}

.address-input:focus {
  border-color: #888;
}

.address-result {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.8;
}

.address-correct {
  color: #1a7a3a;
}

.address-given {
  color: #c0392b;
}

/* Part 3 — test route */
.route-input-label {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}

.route-input {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.route-input:focus {
  border-color: #888;
}

.route-note-test {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}

/* Part 3 — test result table */
.route-result {
  margin-bottom: 24px;
  overflow-x: auto;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.route-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #ddd;
  color: #555;
  font-weight: 600;
}

.route-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.street-correct td {
  background: #eafaf1;
  color: #1a7a3a;
}

.street-wrong td {
  background: #fdecea;
  color: #c0392b;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  padding: 16px 0 8px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
}

.section-divider {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  padding: 20px 0 8px;
  border-top: 2px solid #ccc;
  border-bottom: 1px solid #e0e0e0;
  margin: 16px 0 4px;
}

.section-points {
  font-weight: 400;
  color: #888;
}

.result-scores {
  font-size: 14px;
  color: #555;
  margin-top: 8px;
}

.route-result-sub {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
}

/* --- Quiz (Тест по модули) --- */

.quiz-controls {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.immediate-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  user-select: none;
}

.immediate-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.cat-label {
  font-size: 12px;
  font-weight: 400;
  color: #888;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
}

.addr-feedback {
  margin-top: 8px;
  font-size: 14px;
}

.fb-correct {
  color: #2e7d32;
  font-weight: 600;
}

.fb-wrong {
  color: #c62828;
}

.q-partial {
  border-left: 4px solid #f57c00;
}

.route-score {
  margin: 12px 0 8px;
  font-size: 15px;
}
