/* Instrukcja budowy wagi. Kolory i promienie z tokenów --mel-*. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.mapp-page.mapp-guide { max-width: 960px; }
.mapp-guide { min-width: 0; }
.mapp-guide h1,
.mapp-guide h2,
.mapp-guide h3 { text-wrap: balance; }
.mapp-guide p { margin: 0 0 12px; }
.mapp-guide-sec { margin: 36px 0; }
.mapp-guide-sec h2 {
  margin: 0 0 8px;
  font-size: var(--mel-fs-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.mapp-guide-sec h3,
.mapp-guide-step h3,
.mapp-guide-path h3 {
  margin: 22px 0 8px;
  font-size: var(--mel-fs-lg);
  font-weight: 800;
}
.mapp-guide-step h3,
.mapp-guide-path h3 { margin-top: 0; }

.mapp-guide-img {
  width: 100%;
  height: auto;
  border-radius: var(--mel-r);
}
.mapp-guide-copy > .mapp-guide-img,
.mapp-guide-sec > .mapp-guide-img { margin: 12px 0 16px; }

.mapp-guide-copy ol,
.mapp-guide-copy ul:not(.mapp-guide-chips):not(.mapp-guide-checks) {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  list-style: disc;
}
.mapp-guide-copy ol { list-style: decimal; }
.mapp-guide-copy li { margin: 6px 0; }
.mapp-guide-copy li::marker { color: var(--mel-accent-text); font-weight: 700; }

.mapp-guide-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #fff;
  font-weight: 800;
  font-size: var(--mel-fs-lg);
}
.mapp-guide-brand .mel-logo { width: 32px; height: auto; }

.mapp-guide-hero,
.mapp-guide-foot {
  background: var(--mel-olive);
  color: #f5f5f0;
  border-radius: var(--mel-r-lg);
}
.mapp-guide-hero {
  display: grid;
  gap: 20px;
  padding: 24px 20px;
}
.mapp-guide-hero h1 {
  color: #fff;
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.mapp-guide-hero-accent { display: block; color: var(--mel-honey); }
.mapp-guide-hero p { color: #e7e6dc; }
.mapp-guide-hero .mel-pill,
.mapp-guide-foot .mel-pill {
  background: color-mix(in srgb, #000 28%, var(--mel-olive));
  color: #f5f5f0;
}
.mapp-guide-hero-frame {
  margin: 0;
  padding: 8px;
  background: #fff;
  border-radius: var(--mel-r-lg);
  box-shadow: var(--mel-shadow-lg);
}
.mapp-guide-hero-frame .mapp-guide-img { border-radius: calc(var(--mel-r-lg) - 4px); }

@media (min-width: 900px) {
  .mapp-guide-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    padding: 32px;
  }
}

.mapp-guide-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.mapp-guide-toc {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
  padding: 8px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mapp-guide-toc .mel-chip {
  flex: 0 0 auto;
  min-height: 44px;
  font-weight: 650;
}
@media (min-width: 900px) {
  .mapp-guide-toc {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--mel-bg);
  }
  body:has(#mapp-topbar) .mapp-guide-toc { top: var(--mel-topbar); }
  .mapp-guide [id] { scroll-margin-top: 72px; }
  body:has(#mapp-topbar) .mapp-guide [id] { scroll-margin-top: calc(var(--mel-topbar) + 64px); }
}

.mapp-guide-paths { display: grid; gap: 16px; }
@media (min-width: 700px) {
  .mapp-guide-paths { grid-template-columns: 1fr 1fr; }
}
.mapp-guide-path {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}
.mapp-guide-path p { margin: 0; color: var(--mel-text-2); }
.mapp-guide-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  color: var(--mel-accent-text);
  font-weight: 700;
}

.mapp-guide-note {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--mel-r);
  border-left: 4px solid var(--mel-honey);
  background: var(--mel-warn-soft);
}
.mapp-guide-note p { margin: 0; }
.mapp-guide-note--ok { border-left-color: var(--mel-ok); background: var(--mel-ok-soft); }
.mapp-guide-note--warn { border-left-color: var(--mel-honey); background: var(--mel-warn-soft); }
.mapp-guide-note--danger { border-left-color: var(--mel-danger); background: var(--mel-danger-soft); }

.mapp-guide-table { margin: 8px 0 16px; max-width: 100%; }
.mapp-guide-aff {
  color: var(--mel-accent-text);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mapp-guide-aff:hover { text-decoration-thickness: 2px; }
.mapp-guide-table td .mapp-guide-aff { overflow-wrap: anywhere; }
.mapp-guide-table th,
.mapp-guide-table td { white-space: normal; vertical-align: top; }
@media (max-width: 699px) {
  .mapp-guide-table table,
  .mapp-guide-table tbody,
  .mapp-guide-table tr,
  .mapp-guide-table td { display: block; width: 100%; }
  .mapp-guide-table thead { display: none; }
  .mapp-guide-table tr {
    margin: 0 0 12px;
    padding: 6px 0;
    border: 1px solid var(--mel-border);
    border-radius: var(--mel-r-lg);
    background: var(--mel-surface);
  }
  .mapp-guide-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 8px 14px;
  }
  .mapp-guide-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--mel-muted);
    font-weight: 700;
  }
}

.mapp-guide-step { margin: 0 0 16px; padding: 16px; }
.mapp-guide-step-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.mapp-guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
  background: var(--mel-olive);
  color: var(--mel-honey);
  font-size: 28px;
  font-weight: 800;
}
.mapp-guide-kicker { margin: 2px 0 0; color: var(--mel-muted); font-style: italic; }
.mapp-guide-step-fig { margin: 12px 0 0; }
@media (min-width: 900px) {
  .mapp-guide-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    gap: 20px;
    align-items: start;
  }
  .mapp-guide-step-fig {
    position: sticky;
    top: 12px;
    margin: 0;
  }
  body:has(#mapp-topbar) .mapp-guide-step-fig { top: calc(var(--mel-topbar) + 12px); }
}

.mapp-guide-checks { margin: 8px 0 0; padding: 0; list-style: none; }
.mapp-guide-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
}
.mapp-guide-check input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--mel-primary);
}

.mapp-guide-faq { display: flex; flex-direction: column; gap: 8px; }
.mapp-guide-faq details.mel-card { padding: 0; }
.mapp-guide-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.mapp-guide-faq summary::-webkit-details-marker { display: none; }
.mapp-guide-faq summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.mapp-guide-faq details[open] summary::after { transform: rotate(225deg); }
.mapp-guide-faq details p { margin: 0; padding: 0 16px 14px; color: var(--mel-text-2); }

.mapp-guide-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.mapp-guide-dl { text-decoration: none; }

.mapp-guide-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 40px;
  padding: 24px 20px;
}
.mapp-guide-foot .mapp-guide-brand { margin: 0; }
.mapp-guide-foot .mapp-guide-chips { margin: 0; }
.mapp-guide-cta {
  margin-left: auto;
  background: var(--mel-honey);
  color: #1d2312;
  text-decoration: none;
}
.mapp-guide-cta:hover { filter: brightness(1.05); }
@media (max-width: 600px) {
  .mapp-guide-cta { width: 100%; margin-left: 0; }
}

.mapp-guide-hub-actions { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .mapp-guide-hub-actions { grid-template-columns: repeat(2, minmax(0, 280px)); }
}
