:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #020617;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.1);
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f97373;
  --radius-lg: 1.25rem;
  --transition-fast: 0.15s ease-out;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  max-width: 100% !important;
}

mark.highlight {
  background-color: #22c55e;
  color: black;
  padding: 0 2px;
  border-radius: 3px;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 48%, #000 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden !important;
}

html {
  scroll-behavior: smooth;
}

.page {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.shell {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  padding: 1.1rem 1.2rem 0.4rem;
}

.title-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.disc-badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a 45%, #052e16 100%);
  position: relative;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5), 0 14px 28px rgba(0,0,0,0.65);
  overflow: hidden;
}

.disc-badge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  border: 2px solid rgba(15, 23, 42, 0.6);
}

.disc-badge::after {
  content: "";
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 999px;
  border: 2px solid rgba(190, 242, 100, 0.4);
  top: 10%;
  left: 10%;
}

.title-text h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.title-text h1 span.badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: #bbf7d0;
}

.title-text p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.1s ease-out;
}

.lang-btn.active {
  background: var(--accent-soft);
  color: #bbf7d0;
  font-weight: 600;
}

.lang-btn:hover {
  transform: translateY(-1px);
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 1rem;
  width: 100% !important;
  padding: 0 1.2rem 1.1rem;
  align-items: flex-start;
}

.helper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0 1.2rem 1rem;
}

.helper-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  text-decoration: none;
  transition: border var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.helper-link-btn:hover {
  border-color: rgba(229, 149, 161, 0.6);
  background: rgba(68, 18, 24, 0.45);
  transform: translateY(-1px);
}

.helpers-shell {
  padding: 0 0 0.4rem;
}

.helpers-divider {
  height: 1px;
  margin: 0 1.2rem 1.25rem;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.7), rgba(148, 163, 184, 0));
}

.panel.resources-panel {
  margin: 0 1.2rem 1rem;
  padding: 0.9rem 1rem 1rem;
  background: radial-gradient(circle at top left, rgba(68, 18, 24, 0.96) 0, rgba(41, 12, 18, 0.98) 48%, rgba(24, 8, 12, 1) 100%);
  border: 1px solid rgba(154, 52, 70, 0.5);
  box-shadow: 0 16px 38px rgba(26, 6, 10, 0.6);
}

.resources-panel .pill {
  border-color: rgba(229, 149, 161, 0.38);
  color: rgba(245, 208, 214, 0.95);
}

.resources-panel .resources-toggle-icon {
  color: #f0b8c2;
}

.resources-panel .resources-header h2 {
  color: #fff2f4;
}

.resources-panel label {
  color: #d8aab2;
}

.resources-panel .resource-pill {
  border-color: rgba(205, 118, 132, 0.38);
  background: rgba(57, 17, 24, 0.9);
  color: #fff2f4;
}

.resources-panel .resource-pill:hover,
.resources-panel .resource-pill.active {
  background: rgba(154, 52, 70, 0.24);
  border-color: rgba(229, 149, 161, 0.62);
}

.resources-panel .resource-card,
.resources-panel .diagram-card {
  border-color: rgba(132, 44, 58, 0.72);
  background: linear-gradient(180deg, rgba(53, 15, 22, 0.96), rgba(30, 10, 15, 0.98));
}

.resources-panel .section-toggle {
  border-color: rgba(229, 149, 161, 0.55);
  color: #ffd7de;
}

.resources-panel .diagram-intro,
.resources-panel .diagram-question-subtitle,
.resources-panel .diagram-result-rule {
  color: #f3d9de;
}

.resources-panel .diagram-path-step {
  background: rgba(55, 17, 24, 0.95);
  border-color: rgba(173, 82, 97, 0.42);
  color: #ffe9ed;
}

.resources-panel .diagram-node-note {
  border-color: rgba(190, 117, 129, 0.22);
  background: rgba(74, 25, 33, 0.9);
  color: #fff4f6;
}

.resources-panel .diagram-answer-btn {
  border-color: rgba(168, 90, 103, 0.55);
  background: rgba(70, 22, 30, 0.94);
}

.resources-panel .diagram-answer-btn:hover,
.resources-panel .diagram-answer-btn:focus-visible {
  border-color: rgba(240, 184, 194, 0.72);
  background: rgba(154, 52, 70, 0.26);
}

.resources-panel .diagram-rule-link {
  color: #ffc7d1;
  border-bottom-color: rgba(255, 199, 209, 0.35);
}

.resources-panel .diagram-rule-link:hover {
  border-bottom-color: rgba(255, 199, 209, 0.8);
}

.panel {
  background: radial-gradient(circle at top left, #020617 0, #020617 45%, #020617 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 12px 35px rgba(0,0,0,0.7);
}

label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search-input:focus {
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
  background: rgba(15, 23, 42, 1);
}

.stall-challenge {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), rgba(6, 14, 24, 0) 42%),
    linear-gradient(180deg, rgba(8, 20, 16, 0.96), rgba(2, 6, 23, 0.98));
  box-shadow: inset 0 1px 0 rgba(187, 247, 208, 0.05);
}

.stall-challenge__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stall-challenge__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #86efac;
}

.stall-challenge__title {
  margin: 0;
  font-size: 1.15rem;
  color: #f0fdf4;
}

.stall-challenge__desc {
  margin: 0.65rem 0 0;
  color: #cbd5e1;
  line-height: 1.55;
  font-size: 0.92rem;
}

.stall-challenge__timer {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px dashed rgba(134, 239, 172, 0.32);
  background: rgba(2, 6, 23, 0.88);
  color: #f0fdf4;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.stall-challenge__status {
  margin: 0.7rem 0 0;
  min-height: 2.8rem;
  color: #bbf7d0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.stall-challenge__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.stall-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  transition: transform var(--transition-fast), border var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}

.stall-btn:hover:not(:disabled),
.stall-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
}

.stall-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stall-btn--primary {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
  color: #052e16;
  font-weight: 700;
}

.stall-btn--ghost {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
}

.rules-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rules-count {
  font-size: 0.8rem;
  color: var(--muted);
  display: none;
}

.pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: rgba(148, 163, 184, 0.95);
}

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 540px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(55, 65, 81, 0.9) transparent;
}

.rules-list::-webkit-scrollbar {
  width: 8px;
}
.rules-list::-webkit-scrollbar-track {
  background: transparent;
}
.rules-list::-webkit-scrollbar-thumb {
  background: rgba(31, 41, 55, 1);
  border-radius: 999px;
}

.section-card {
  background: radial-gradient(circle at top left, #020617 0, #020617 45%, #020617 100%);
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 0.65rem 0.8rem;
  transition: border var(--transition-fast), background var(--transition-fast),
    transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.section-card:hover {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  cursor: pointer;
}

.section-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-toggle {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: rgba(209, 213, 219, 0.9);
  flex-shrink: 0;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.section-meta {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.section-body {
  margin-top: 0.45rem;
  display: none;
}

.rule-row {
  margin-bottom: 0.55rem;
}

.rule-row-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  cursor: pointer;
}

.rule-number-small {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.rule-text {
  font-size: 0.84rem;
  line-height: 1.4;
}

/* Tap-to-cycle colors */
.rule-lang-az { color: #ffffff !important; }
.rule-lang-en { color: #bbf7d0 !important; }
.rule-lang-ru { color: #e9d5ff !important; }

.examples {
  margin-top: 0.35rem;
  border-top: 1px dashed rgba(55, 65, 81, 0.9);
  padding-top: 0.35rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.examples-toggle:hover {
  opacity: 0.85;
}

.examples-body {
  border-left: 2px solid rgba(55, 65, 81, 0.6);
  padding-left: 0.6rem;
  margin-left: 0.2rem;
  font-size: 0.83rem;
  margin-top: 0.35rem;
  white-space: normal;
}

.resources-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.resources-header-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.resources-header h2 {
  margin: 0;
  font-size: 1rem;
}

.resources-toggle-icon {
  font-size: 0.85rem;
  color: var(--muted);
}

.resources-body {
  margin-top: 0.9rem;
}

.resource-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.resource-pill {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  padding: 0.48rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background var(--transition-fast), border var(--transition-fast), transform 0.1s ease-out;
}

.resource-pill:hover,
.resource-pill.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.55);
  transform: translateY(-1px);
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.diagram-intro {
  margin: 0 0 0.9rem;
  color: #d4dbe7;
  line-height: 1.55;
}

.diagram-meta {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.diagram-scenario-block {
  flex: 1;
  min-width: 0;
}

.diagram-scenario-block label {
  margin-bottom: 0.5rem;
}

.diagram-select-wrap {
  position: relative;
}

.diagram-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid #0f2f67;
  border-bottom: 2px solid #0f2f67;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.diagram-scenario-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.78rem 2.9rem 0.78rem 0.95rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(248, 250, 252, 0.96);
  color: #133b7a;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.2);
  transition: border var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.diagram-scenario-select:focus {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.42), 0 12px 28px rgba(2, 6, 23, 0.26);
}

.diagram-reset-btn {
  min-height: 42px;
  white-space: nowrap;
}

.diagram-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.diagram-path-step {
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(71, 85, 105, 0.45);
  color: #d5deea;
  font-size: 0.82rem;
}

.diagram-card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(2, 6, 23, 1));
  padding: 1rem;
}

.diagram-card h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.15;
  color: #ffffff;
}

.diagram-question-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.diagram-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.diagram-answer-btn {
  border: 1px solid rgba(100, 116, 139, 0.58);
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.96);
  color: var(--text);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.diagram-answer-btn:hover,
.diagram-answer-btn:focus-visible {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.diagram-node-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.92);
  color: #edf2f7;
  line-height: 1.5;
}

.diagram-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.diagram-result-rule {
  color: #d4dbe7;
  line-height: 1.6;
  margin: 0.8rem 0 1rem;
}

.diagram-result-note {
  color: var(--muted);
}

.diagram-rule-link {
  color: #86efac;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(134, 239, 172, 0.35);
}

.diagram-rule-link:hover {
  border-bottom-color: rgba(134, 239, 172, 0.8);
}

.resource-card {
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(2, 6, 23, 0.9);
  border-radius: 0.9rem;
  overflow: hidden;
}

.resource-card-header {
  padding: 0.8rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.resource-card-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.resource-card-body {
  display: none;
  padding: 0 0.95rem 0.95rem;
}

.resource-card-body.open {
  display: block;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.resource-image {
  width: 100%;
  display: block;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.rule-inline-figure {
  margin: 0.9rem auto 0;
  text-align: center;
  width: 100%;
}

.rule-inline-figure img {
  width: 100%;
  max-width: 680px;
  height: auto;
  display: block;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border-radius: 6px;
}

.empty-state {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 1.6rem 0.6rem;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.6rem 1.2rem 1rem;
  border-top: 1px solid rgba(31, 41, 55, 1);
}

footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
footer a:hover {
  text-decoration: underline;
}

/* Guided tour */
.tour-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
  z-index: 9999;
  pointer-events: none;
}

.tour-tooltip {
  position: fixed;
  min-width: 260px;
  max-width: min(420px, 90vw);
  background: linear-gradient(145deg, #0f172a, #0b1221);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 1rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  padding: 0.85rem 1rem;
  color: #e5e7eb;
  pointer-events: auto;
}

.tour-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tour-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.tour-progress {
  font-size: 0.75rem;
  color: var(--muted);
}

.tour-body {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #cbd5e1;
  margin-bottom: 0.65rem;
}

.tour-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.tour-btn {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform var(--transition-fast), border var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast);
}

.tour-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.6);
}

.tour-btn.primary {
  background: var(--accent);
  color: #052e16;
  border-color: rgba(34, 197, 94, 0.8);
}

.tour-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
}

.tour-highlight {
  position: relative;
  z-index: 9998 !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.8), 0 0 0 10px rgba(34, 197, 94, 0.15),
    0 10px 26px rgba(0, 0, 0, 0.6);
  border-radius: 0.75rem;
}

/* Mobile adjustments */
@media (max-width: 800px) {
  header {
    padding: 1rem 0.85rem 0.4rem;
  }
  .helper-links {
    padding: 0 0.85rem 1rem;
  }
  .resources-panel {
    margin: 0 0.85rem 1rem;
  }
  .helpers-divider {
    margin: 0 0.85rem 1.1rem;
  }
  .main {
    padding: 0 0.85rem 0.9rem;
    grid-template-columns: 1fr;
  }
  .rules-list {
    max-height: none;
  }
  .diagram-meta {
    flex-direction: column;
    align-items: stretch;
  }
  .diagram-answer-grid {
    grid-template-columns: 1fr;
  }
  .stall-challenge__actions {
    flex-direction: column;
  }
  .section-meta {
    display: none;
  }
  footer {
    padding: 0.5rem 0.85rem 0.9rem;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem !important;
  }

  .title-text h1 {
    font-size: 1.1rem;
  }

  .panel {
    padding: 0.85rem 0.9rem !important;
    border-radius: 1rem !important;
  }

  .helper-links {
    flex-direction: column;
  }

  .helper-link-btn {
    width: 100%;
  }

  .diagram-scenario-select {
    background: rgba(255, 255, 255, 0.98);
    color: #12376f;
    border-color: rgba(148, 163, 184, 0.7);
  }

  .section-card {
    padding: 0.7rem 0.85rem !important;
  }

  .rule-row {
    margin-left: 0 !important;
  }

  .rule-row-header {
    margin-left: 0.2rem !important;
  }

  .rule-number-small {
    font-size: 0.7rem !important;
    padding: 0.05rem 0.3rem !important;
  }

  .rule-text {
    font-size: 0.92rem !important;
    line-height: 1.45 !important;
  }

  .examples {
    margin-top: 0.3rem !important;
    padding-left: 0.5rem !important;
  }

  .rules-list {
    gap: 0.55rem !important;
  }

  footer {
    padding-top: 0.4rem !important;
    font-size: 0.65rem !important;
  }
}

.rule-number-small.depth-0 {
  background: rgba(30, 64, 175, 0.35);
  color: #a5b4fc;
}

.rule-number-small.depth-1 {
  background: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.rule-number-small.depth-2 {
  background: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
}

.rule-number-small.depth-3 {
  background: rgba(249, 115, 22, 0.25);
  color: #fed7aa;
}

.rule-number-small.depth-4 {
  background: rgba(244, 114, 182, 0.25);
  color: #fbcfe8;
}
