:root {
  --bg: #f5f7fb;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --brand: #1f6feb;
  --brand-dark: #174ea6;
  --success: #0f766e;
  --warning: #a15c07;
  --danger: #b42318;
  --soft-blue: #eaf2ff;
  --soft-green: #e8f7f3;
  --soft-amber: #fff4df;
  --soft-red: #fff0ed;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.11);
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.guide-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  background: #101828;
  color: #eef4ff;
}

.sidebar__brand {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.sidebar__brand strong {
  font-size: 20px;
}

.sidebar__brand span,
.sidebar__meta {
  color: #b7c6dc;
  font-size: 13px;
}

.search-box {
  width: 100%;
  margin: 12px 0 16px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
}

.search-box::placeholder {
  color: #b7c6dc;
}

.nav-list {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-list a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 8px;
  color: #e7eefb;
  font-size: 14px;
}

.nav-list a:hover,
.nav-list a.is-active {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.main {
  min-width: 0;
}

.hero {
  padding: 56px 48px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--brand-dark);
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero p {
  max-width: 860px;
  margin: 14px 0 0;
  color: #344054;
  font-size: 18px;
}

.hero__actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 32px 72px;
}

.toc,
.section,
.matrix,
.premortem,
.roadmap-panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.05);
}

.toc h2,
.matrix h2,
.premortem h2,
.roadmap-panel h2,
.section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  letter-spacing: 0;
}

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

.module-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.module-card strong {
  font-size: 16px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.badge[data-status*="реалізовано частково"],
.badge[data-status*="неможливо"] {
  background: var(--soft-amber);
  color: var(--warning);
}

.badge[data-status="реалізовано"] {
  background: var(--soft-green);
  color: var(--success);
}

.badge[data-status*="не знайдено"],
.badge[data-status*="відсут"] {
  background: var(--soft-red);
  color: var(--danger);
}

.section__header {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.summary {
  margin: 0 0 16px;
  color: #344054;
}

.routes {
  margin: 12px 0 18px;
}

.route-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.route-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.route-chip {
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef2f6;
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

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

.scenario-card,
.action-steps,
.field-guide,
.honest-status,
.examples-block,
.mistakes-block,
.what-next {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.scenario-card {
  padding: 14px;
}

.scenario-card h3,
.action-steps h3,
.field-guide h3,
.honest-status h3,
.examples-block h3,
.mistakes-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.scenario-card p,
.scenario-card ul,
.examples-block ul,
.mistakes-block ul {
  margin: 0;
}

.scenario-card ul,
.examples-block ul,
.mistakes-block ul,
.honest-status ul {
  display: grid;
  gap: 7px;
  padding-left: 20px;
}

.action-steps,
.field-guide,
.honest-status,
.examples-block,
.mistakes-block {
  margin: 18px 0;
  padding: 16px;
}

.action-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.action-step:first-of-type {
  border-top: 0;
}

.action-step__number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.action-step__body strong {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--brand-dark);
}

.action-step__body p {
  margin: 8px 0 0;
}

.action-step__path {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-step__result {
  color: var(--success);
  font-weight: 700;
}

.field-guide {
  overflow-x: auto;
}

.field-guide table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.field-guide th,
.field-guide td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.field-guide th {
  color: #475467;
  font-size: 13px;
}

.field-guide__field {
  color: var(--ink);
  font-weight: 800;
}

.honest-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  background: var(--soft-amber);
}

.honest-status h3 {
  grid-column: 1 / -1;
}

.honest-status__card {
  padding: 12px;
  border-radius: 8px;
  background: #fffaf0;
}

.honest-status__card strong {
  color: #7a4a00;
}

.examples-block {
  border-color: #9ed8cc;
  background: var(--soft-green);
}

.mistakes-block {
  border-color: #ffb4a8;
  background: var(--soft-red);
}

.what-next {
  margin: 18px 0;
  padding: 14px 16px;
  border-color: #9fb4d2;
  background: var(--soft-blue);
  color: var(--brand-dark);
  font-weight: 800;
}

.steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}

.step__text h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.step__text h3::before {
  counter-increment: step;
  content: counter(step) ". ";
  color: var(--brand-dark);
}

.screenshot {
  min-height: 210px;
  border: 1px dashed #9fb4d2;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, #f8fbff, #f8fbff 12px, #eef4ff 12px, #eef4ff 24px);
  overflow: hidden;
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot__placeholder {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: #475467;
}

.screenshot__placeholder strong {
  display: block;
  color: #1d2939;
}

.caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.note,
.warning,
.next-action {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.warning {
  border: 1px solid #f2c77a;
  background: var(--soft-amber);
  color: #663c00;
}

.next-action {
  border: 1px solid #9ed8cc;
  background: var(--soft-green);
  color: #0f4f49;
}

.legal-risk {
  border: 1px solid #ffb4a8;
  background: var(--soft-red);
  color: #7a271a;
}

.checklist,
.risk-list,
.premortem-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.checklist li,
.risk-list li,
.premortem-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checklist li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--success);
  font-weight: 900;
}

.risk-list li::before {
  content: "!";
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-amber);
  color: var(--warning);
  font-weight: 900;
  font-size: 12px;
}

.matrix table {
  width: 100%;
  border-collapse: collapse;
}

.matrix th,
.matrix td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.matrix th {
  color: #475467;
  font-size: 13px;
}

.roadmap {
  display: grid;
  gap: 10px;
  counter-reset: road;
}

.roadmap li {
  list-style: none;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.roadmap li::before {
  counter-increment: road;
  content: counter(road);
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .guide-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .hero {
    padding: 38px 24px 28px;
  }

  .content {
    padding: 24px 18px 56px;
  }

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

  .scenario-grid,
  .honest-status {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .nav-list,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .section__header {
    display: grid;
  }

  .toc,
  .section,
  .matrix,
  .premortem,
  .roadmap-panel {
    padding: 18px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .guide-shell {
    display: block;
  }

  .sidebar,
  .toolbar,
  .hero__actions,
  .search-box {
    display: none !important;
  }

  .hero {
    padding: 0 0 20px;
    background: #fff;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .section,
  .matrix,
  .premortem,
  .roadmap-panel,
  .toc {
    break-inside: avoid;
    box-shadow: none;
  }

  a {
    color: #000;
  }
}

/* Interactive walkthrough layer */
.module-card--tour {
  position: relative;
  min-height: 178px;
}

.module-card__meta {
  display: inline-flex;
  width: fit-content;
  margin-top: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.walkthrough {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.walkthrough__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.walkthrough__header h2 {
  margin: 0;
  color: var(--ink);
}

.walkthrough__meta {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-width: 210px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tour-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.tour-frame-shell {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.tour-visual {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

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

.hotspot-pin {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.35);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.hotspot-pin::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid rgba(15, 118, 110, 0.28);
  border-radius: inherit;
  animation: hotspotPulse 1.8s ease-out infinite;
}

.hotspot-pin.is-active {
  background: #c2410c;
  box-shadow: 0 16px 34px rgba(194, 65, 12, 0.38);
}

.hotspot-pin.is-active::after {
  border-color: rgba(194, 65, 12, 0.36);
}

.hotspot-arrow {
  position: absolute;
  z-index: 3;
  display: block;
  width: 70px;
  height: 3px;
  border-radius: 99px;
  background: #c2410c;
  transform: rotate(-18deg);
  transform-origin: right center;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.28);
}

.hotspot-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -6px;
  border-left: 13px solid #c2410c;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.typed-demo {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  padding: 7px 10px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.96);
  color: #134e4a;
  font: 800 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transform: translateY(-50%);
  white-space: nowrap;
  overflow: hidden;
}

.typed-demo::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -2px;
  animation: caretBlink 0.85s step-end infinite;
}

.tour-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tour-progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
}

.tour-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #c2410c);
  transition: width 180ms ease;
}

.tour-side h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.tour-caption {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hotspot-list {
  display: grid;
  gap: 10px;
}

.hotspot-card {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.hotspot-card.is-active {
  border-color: rgba(194, 65, 12, 0.35);
  background: #fff7ed;
  box-shadow: 0 12px 26px rgba(194, 65, 12, 0.12);
}

.hotspot-card.is-collapsed {
  display: none;
}

.hotspot-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hotspot-card__top span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-weight: 900;
}

.hotspot-card.is-active .hotspot-card__top span {
  background: #c2410c;
}

.hotspot-card__top strong {
  color: var(--ink);
}

.hotspot-card p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.55;
}

.hotspot-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.hotspot-card dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
}

.hotspot-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hotspot-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.legal-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid #c2410c;
  border-radius: 10px;
  background: #fff7ed;
  color: #7c2d12;
  line-height: 1.45;
}

.footnote {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-size: 13px;
}

.tour-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-controls .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mock-email-frame {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 520px;
  background: #eef2ff;
}

.mock-email-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 28px 18px;
  border-right: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.mock-email-sidebar span:first-child {
  color: #0f766e;
}

.mock-email-message {
  align-self: center;
  justify-self: center;
  width: min(520px, calc(100% - 48px));
  padding: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.mock-email-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.mock-email-message h3 {
  margin: 0 0 10px;
  color: var(--ink);
}

.mock-email-message p {
  color: var(--muted);
  line-height: 1.6;
}

.mock-email-message button {
  display: inline-flex;
  margin: 12px 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  font-weight: 900;
}

.mock-email-small {
  font-size: 13px;
}

.reference-panel {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reference-section {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.reference-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.reference-section__body {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

@keyframes hotspotPulse {
  0% { opacity: 0.85; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

@media (max-width: 1180px) {
  .tour-stage {
    grid-template-columns: 1fr;
  }

  .tour-frame-shell {
    position: relative;
    top: auto;
  }
}

@media (max-width: 680px) {
  .walkthrough {
    padding: 16px;
  }

  .walkthrough__header {
    display: grid;
  }

  .walkthrough__meta {
    justify-content: start;
  }

  .hotspot-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mock-email-frame {
    grid-template-columns: 1fr;
  }

  .mock-email-sidebar {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid #cbd5e1;
  }
}

@media print {
  .walkthrough {
    break-inside: avoid;
    box-shadow: none;
  }

  .tour-stage {
    display: block;
  }

  .tour-frame-shell {
    position: relative;
    top: auto;
    margin-bottom: 12px;
  }

  .hotspot-card.is-collapsed {
    display: block;
  }

  .tour-controls,
  .hotspot-pin::after {
    display: none !important;
  }

  .hotspot-pin {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
