/* ============================================================
   SPONTY.PL - stopka produktu i dokumenty prawne
   Rozszerzenie systemu v3; korzysta wyłącznie z jego tokenów.
   ============================================================ */

/* ---------- stopka produktu ---------- */
.product-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  padding:
    58px max(28px, calc((100vw - 1180px) / 2))
    max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(circle at 86% 12%, rgba(230, 240, 255, .10), transparent 31%),
    radial-gradient(circle at 7% 100%, rgba(49, 95, 135, .10), transparent 30%),
    var(--navy);
  color: #fff;
}

.product-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: max(28px, calc((100vw - 1180px) / 2));
  left: max(28px, calc((100vw - 1180px) / 2));
  height: 1px;
  background: linear-gradient(90deg, var(--coral), var(--teal), transparent 72%);
  opacity: .72;
}

.product-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #fff;
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.015em;
}

.product-footer-wordmark {
  display: block;
  width: 160px;
  height: 31px;
  background: url("/brand/sponty-wordmark-white.png") center/contain no-repeat;
}

.product-footer-logo .logo-mark,
.product-footer-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--coral) 20%, var(--violet));
  color: #fff;
  box-shadow: 0 8px 20px rgba(10, 27, 52, .18);
}

.product-footer-lead {
  max-width: 440px;
  margin-top: 18px;
  color: rgba(255, 255, 255, .66);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.75;
}

.product-footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(3, minmax(140px, 1fr));
  gap: 46px clamp(28px, 4vw, 64px);
  width: min(100%, 1180px);
  margin: 0 auto;
}

.product-footer-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.product-footer-column > h2,
.product-footer-column > h3,
.product-footer-column > .product-footer-title {
  margin: 4px 0 13px;
  color: rgba(255, 255, 255, .48);
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.product-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 100%;
  border-radius: 9px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: color .18s ease, transform .18s ease, background-color .18s ease;
}

.product-footer-link:hover {
  color: #fff;
  transform: translateX(3px);
}

.product-footer-link[aria-current="page"] {
  color: #fff;
}

.product-footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.product-footer-contact svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--teal);
}

.product-footer-bottom {
  display: block;
  width: min(100%, 1180px);
  margin: 42px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .44);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.product-footer-bottom > p {
  margin: 0;
}

.product-footer-bottom a {
  color: rgba(255, 255, 255, .64);
  transition: color .18s ease;
}

.product-footer-bottom a:hover {
  color: #fff;
}

/* Stopka nie konkuruje z aktywną rozmową planera. Stan planera zostaje
   zachowany po zmianie trasy, więc nie może ukrywać dokumentów prawnych. */
html.planner-session-active:not(.product-legal-route) .product-footer,
html:not(.product-legal-route) body.planner-session-active .product-footer,
html:not(.product-legal-route) .planner-session-active .product-footer,
html:not(.product-legal-route) [data-planner-app].planner-session-active ~ .product-footer,
html.product-planner-engaged:not(.product-legal-route) .product-footer,
html:not(.product-legal-route) body.product-planner-engaged .product-footer,
html:not(.product-legal-route) .product-planner-engaged .product-footer,
html:not(.product-legal-route) .product-footer.product-planner-engaged {
  display: none !important;
}

html.product-legal-route [data-product-footer] > .product-footer {
  display: block !important;
}

/* ---------- widok prawny ---------- */
.legal-view {
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 61px);
  overflow: clip;
  background: #f7f8fa;
  color: var(--ink);
}

.legal-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 52px 28px 88px;
}

.legal-page {
  width: 100%;
  min-width: 0;
}

.legal-hero {
  position: relative;
  max-width: 780px;
  padding: 0 0 34px;
}

.legal-hero h1 {
  max-width: 760px;
  margin: 9px 0 12px;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.legal-hero h1:focus {
  outline: none;
}

.legal-hero > p:not(.legal-kicker):not(.legal-version) {
  max-width: 680px;
  color: var(--slate);
  font-size: 15.5px;
  font-weight: 450;
  line-height: 1.68;
}

.legal-kicker,
.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--slate-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-kicker::before,
.legal-eyebrow::before {
  content: none;
}

.legal-version {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  margin-top: 17px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--slate);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: none;
}

.legal-version::before {
  content: none;
}

.legal-layout {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  align-items: start;
  gap: clamp(34px, 5vw, 58px);
}

.legal-nav {
  position: sticky;
  top: 88px;
  display: flex;
  min-width: 0;
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  flex-direction: column;
  gap: 1px;
  padding: 0 24px 0 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 99, 127, .24) transparent;
  backdrop-filter: none;
}

.legal-nav > h2,
.legal-nav > h3,
.legal-nav > .legal-nav-title {
  margin: 18px 0 7px;
  color: var(--slate-2);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-nav a {
  display: block;
  padding: 7px 0 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.legal-nav a:hover {
  background: transparent;
  color: var(--navy);
  transform: none;
}

.legal-nav a[aria-current="location"],
.legal-nav a[aria-current="page"],
.legal-nav a.is-active {
  border-left-color: var(--coral);
  background: transparent;
  color: var(--navy);
  font-weight: 750;
}

.legal-nav .legal-nav-home {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  border-left: 0;
  border-radius: 0;
  padding: 0 0 14px;
  color: var(--navy);
  font-weight: 800;
}

.legal-article {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-wrap: anywhere;
}

.legal-article address {
  margin: 15px 0;
  padding: 4px 0 4px 16px;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--slate);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.72;
}

.legal-article address strong {
  color: var(--navy);
}

.legal-article > :first-child,
.legal-section > :first-child {
  margin-top: 0;
}

.legal-article > :last-child,
.legal-section > :last-child {
  margin-bottom: 0;
}

.legal-section {
  padding: 0 0 32px;
  margin: 0 0 32px;
  border-bottom: 1px solid var(--line-2);
  scroll-margin-top: 96px;
}

.legal-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.legal-article h2,
.legal-section h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -.025em;
}

.legal-article h3,
.legal-section h3 {
  margin: 28px 0 10px;
  color: var(--navy-2);
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -.012em;
}

.legal-article p,
.legal-article li,
.legal-section p,
.legal-section li {
  color: var(--slate);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.72;
}

.legal-article p + p,
.legal-section p + p {
  margin-top: 13px;
}

.legal-article ul,
.legal-article ol,
.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 9px;
  margin: 13px 0 0;
  padding-left: 21px;
}

.legal-article li::marker,
.legal-section li::marker {
  color: var(--coral);
  font-weight: 800;
}

.legal-article strong,
.legal-section strong {
  color: var(--ink);
  font-weight: 750;
}

.legal-article a:not(.btn):not(.legal-submit),
.legal-section a:not(.btn):not(.legal-submit) {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(12, 140, 127, .32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.legal-article a:not(.btn):not(.legal-submit):hover,
.legal-section a:not(.btn):not(.legal-submit):hover {
  color: var(--navy);
  text-decoration-color: currentColor;
}

.legal-callout {
  position: relative;
  margin: 0 0 28px;
  padding: 14px 16px 14px 18px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #eef1f5;
  color: var(--slate);
}

.legal-callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--navy);
}

.legal-callout > :first-child {
  margin-top: 0;
}

.legal-callout > :last-child {
  margin-bottom: 0;
}

.legal-callout p,
.legal-callout li {
  color: inherit;
}

.legal-callout address {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.legal-callout.is-important,
.legal-callout[data-tone="important"] {
  border-color: rgba(49, 95, 135, .25);
  background: var(--coral-soft);
  color: var(--coral-dark);
}

.legal-callout.is-important::before,
.legal-callout[data-tone="important"]::before {
  background: var(--coral);
}

.legal-callout.is-info {
  border-color: transparent;
  background: #eef1f5;
  color: var(--slate);
}

.legal-callout.is-info::before {
  background: var(--navy);
}

/* Karty odsyłające do powiązanych dokumentów. */
.legal-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.legal-card-link {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 28px;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none !important;
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease;
}

.legal-card-link strong {
  flex: 0 0 42%;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -.01em;
}

.legal-card-link span {
  flex: 1;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.58;
}

.legal-card-link:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

/* Kontener tabeli powinien otaczać element table. Wariant z klasą
   bezpośrednio na table również pozostaje czytelny i przewijalny. */
.legal-table {
  width: 100%;
  max-width: 100%;
  margin: 20px 0 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 99, 127, .30) transparent;
}

.legal-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: var(--ink);
}

table.legal-table {
  display: block;
  min-width: 0;
  border-collapse: collapse;
  white-space: normal;
}

.legal-table th,
.legal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
  font-size: 11.5px;
  line-height: 1.58;
}

.legal-table th {
  background: var(--bg);
  color: var(--navy);
  font-weight: 800;
  letter-spacing: .01em;
}

.legal-table td {
  color: var(--slate);
  font-weight: 500;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 20px 0 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 99, 127, .30) transparent;
}

.legal-table-wrap > table.legal-table {
  display: table;
  width: 100%;
  min-width: 680px;
  margin: 0;
  overflow: visible;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.legal-actions .btn,
.legal-actions a,
.legal-actions button {
  min-height: 43px;
}

/* ---------- formularze kontaktu i zgłoszeń ---------- */
.legal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.legal-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.legal-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.legal-form fieldset.legal-field {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
}

.legal-form fieldset.legal-field > legend {
  padding: 0 7px;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.4;
}

.legal-field.is-wide,
.legal-field[data-span="full"],
.legal-checkbox,
.legal-form > .legal-actions,
.legal-form > .legal-submit,
.legal-form > .legal-status {
  grid-column: 1 / -1;
}

.legal-field label,
.legal-field > span:first-child {
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.legal-field input,
.legal-field select,
.legal-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.legal-field textarea {
  min-height: 132px;
  resize: vertical;
}

.legal-field input::placeholder,
.legal-field textarea::placeholder {
  color: var(--slate-2);
  opacity: .82;
}

.legal-field input:hover,
.legal-field select:hover,
.legal-field textarea:hover {
  border-color: #c6d0de;
}

.legal-field input:focus,
.legal-field select:focus,
.legal-field textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: none;
}

.legal-field [aria-invalid="true"] {
  border-color: var(--coral);
  background: #fffafa;
}

.legal-field small {
  color: var(--slate-2);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

.legal-form-help {
  margin: 0;
  padding: 11px 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  color: var(--slate);
  font-size: 10.5px !important;
  font-weight: 500;
  line-height: 1.6 !important;
}

.legal-checkbox {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
}

.legal-checkbox input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border-radius: 5px;
  accent-color: var(--teal);
}

.legal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(10, 27, 52, .18);
  transition: background-color .18s ease, box-shadow .18s ease, transform .16s ease;
}

.legal-submit:hover {
  background: var(--coral-dark);
  box-shadow: 0 8px 20px rgba(10, 27, 52, .24);
  transform: translateY(-1px);
}

.legal-submit:active {
  transform: scale(.975);
}

.legal-submit:disabled,
.legal-submit[aria-disabled="true"] {
  cursor: not-allowed;
  box-shadow: none;
  opacity: .54;
  transform: none;
}

.legal-form.is-busy {
  cursor: progress;
}

.legal-form.is-busy .legal-submit {
  gap: 9px;
}

.legal-form.is-busy .legal-submit::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: legalSpin .72s linear infinite;
}

@keyframes legalSpin {
  to { transform: rotate(360deg); }
}

.legal-status,
.legal-form-status {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.55;
}

.legal-status:empty,
.legal-form-status:empty {
  display: none;
}

.legal-status.is-visible {
  display: block;
}

.legal-status.is-info,
.legal-status[data-state="info"] {
  border-color: rgba(49, 95, 135, .22);
  background: var(--violet-soft);
  color: var(--accent-strong);
}

.legal-status.is-success,
.legal-status[data-state="success"] {
  border-color: rgba(49, 95, 135, .24);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.legal-status.is-error,
.legal-status[data-state="error"] {
  border-color: rgba(49, 95, 135, .26);
  background: var(--coral-soft);
  color: var(--coral-dark);
}

/* ---------- dostępność ---------- */
.product-footer a:focus-visible,
.legal-view a:focus-visible,
.legal-view button:focus-visible,
.legal-view input:focus-visible,
.legal-view select:focus-visible,
.legal-view textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 72%, white);
  outline-offset: 3px;
}

.product-footer a:focus-visible {
  border-radius: 9px;
  outline-color: #fff;
}

/* ---------- średnie ekrany ---------- */
@media (max-width: 1000px) {
  .product-footer-grid {
    grid-template-columns: minmax(240px, 1.35fr) repeat(2, minmax(140px, 1fr));
  }

  .product-footer-column:first-child {
    grid-row: span 2;
  }

  .legal-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
  }

  .legal-article {
    padding: 0;
  }
}

/* ---------- mobile / instalowalna aplikacja ---------- */
@media (max-width: 820px) {
  /* Główny planner mobilny pozostaje skupiony i bez dużej stopki. */
  .product-mobile .product-footer {
    display: none;
  }

  /* Trasa prawna zmienia zamknięty ekran aplikacji w pełną,
     naturalnie przewijaną stronę i usuwa dolny pasek aplikacji. */
  html.product-mobile.product-legal-route,
  html.product-mobile.product-legal-route body {
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  html.product-mobile.product-legal-route body {
    padding: 0;
  }

  html.product-mobile.product-legal-route .page,
  html.product-mobile.product-legal-route .phone,
  html.product-mobile.product-legal-route .screen {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  html.product-mobile.product-legal-route .screen {
    display: block;
    padding: 0;
    background: var(--bg);
  }

  html.product-mobile.product-legal-route .tabbar {
    display: none !important;
  }

  html.product-mobile.product-legal-route .legal-view,
  html.product-mobile.product-legal-route .product-footer {
    display: block;
  }

  html.product-mobile.product-legal-route .legal-view {
    min-height: 100dvh;
    overflow: visible;
  }

  .legal-shell {
    width: 100%;
    max-width: 100%;
    padding:
      max(28px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      56px
      max(16px, env(safe-area-inset-left));
  }

  .legal-hero {
    padding-bottom: 30px;
  }

  .legal-hero h1 {
    margin-top: 12px;
    font-size: clamp(31px, 10vw, 40px);
    line-height: 1.1;
  }

  .legal-hero > p:not(.legal-kicker):not(.legal-version) {
    font-size: 13.5px;
    line-height: 1.7;
  }

  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .legal-nav {
    position: sticky;
    z-index: 20;
    top: max(8px, env(safe-area-inset-top));
    display: flex;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    flex-direction: row;
    gap: 6px;
    padding: 8px 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #f7f8fa;
    box-shadow: none;
    scroll-padding-inline: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .legal-nav::-webkit-scrollbar {
    display: none;
  }

  .legal-nav > h2,
  .legal-nav > h3,
  .legal-nav > .legal-nav-title {
    display: none;
  }

  .legal-nav a {
    min-width: max-content;
    min-height: 38px;
    padding: 10px 9px;
    border-left: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .legal-nav a:hover {
    transform: none;
  }

  .legal-nav .legal-nav-home {
    margin: 0;
    padding: 10px 12px 10px 0;
    border: 0;
    border-right: 1px solid var(--line-2);
    border-radius: 9px;
  }

  .legal-article {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .legal-section {
    padding-bottom: 29px;
    margin-bottom: 29px;
    scroll-margin-top: 18px;
  }

  .legal-article h2,
  .legal-section h2 {
    font-size: 21px;
  }

  .legal-article h3,
  .legal-section h3 {
    font-size: 15px;
  }

  .legal-article p,
  .legal-article li,
  .legal-section p,
  .legal-section li {
    font-size: 14px;
    line-height: 1.72;
  }

  .legal-callout {
    padding: 16px 16px 16px 18px;
  }

  .legal-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .legal-card-link {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
  }

  .legal-card-link strong {
    flex-basis: auto;
  }

  .legal-table {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    overscroll-behavior-x: contain;
  }

  .legal-table table {
    min-width: 560px;
  }

  .legal-table-wrap {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .legal-table-wrap > table.legal-table {
    min-width: 560px;
  }

  .legal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .legal-actions .btn,
  .legal-actions a,
  .legal-actions button,
  .legal-submit {
    width: 100%;
  }

  .legal-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding: 18px 14px;
    border-radius: 8px;
  }

  .legal-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  .legal-form fieldset.legal-field {
    padding: 15px 13px;
  }

  .legal-field,
  .legal-field.is-wide,
  .legal-field[data-span="full"],
  .legal-checkbox,
  .legal-form > .legal-actions,
  .legal-form > .legal-submit,
  .legal-form > .legal-status {
    grid-column: auto;
  }

  html.product-mobile.product-legal-route .product-footer {
    padding:
      42px max(18px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
  }

  html.product-mobile.product-legal-route .product-footer::before {
    right: max(18px, env(safe-area-inset-right));
    left: max(18px, env(safe-area-inset-left));
  }

  html.product-mobile.product-legal-route .product-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  html.product-mobile.product-legal-route .product-footer-column:first-child {
    grid-row: auto;
  }

  html.product-mobile.product-legal-route .product-footer-bottom {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    margin-top: 34px;
  }

  html.product-mobile.product-legal-route .product-footer-bottom > p:last-child {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .product-footer {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .product-footer::before {
    right: max(18px, env(safe-area-inset-right));
    left: max(18px, env(safe-area-inset-left));
  }

  .product-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .product-footer-column:first-child {
    grid-row: auto;
  }

  .product-footer-bottom {
    margin-top: 34px;
  }
}

/* ---------- ograniczony ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  .product-footer-link,
  .product-footer-bottom a,
  .legal-nav a,
  .legal-card-link,
  .legal-article a,
  .legal-section a,
  .legal-field input,
  .legal-field select,
  .legal-field textarea,
  .legal-submit {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .product-footer-link:hover,
  .legal-nav a:hover,
  .legal-card-link:hover,
  .legal-submit:hover,
  .legal-submit:active {
    transform: none;
  }
}

/* ---------- wydruk dokumentów ---------- */
@media print {
  @page {
    margin: 16mm;
  }

  html.product-legal-route,
  html.product-legal-route body,
  .legal-view {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .product-footer,
  .legal-nav,
  .legal-actions,
  .legal-form,
  html.product-legal-route .topnav,
  html.product-legal-route .appbar,
  html.product-legal-route .tabbar {
    display: none !important;
  }

  .legal-shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .legal-hero {
    max-width: none;
    padding-bottom: 20px;
  }

  .legal-hero h1 {
    font-size: 28pt;
  }

  .legal-layout {
    display: block;
  }

  .legal-article {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .legal-section,
  .legal-callout,
  .legal-table,
  .legal-table-wrap {
    break-inside: avoid;
  }

  .legal-table-wrap {
    overflow: visible;
    border-color: #bbb;
  }

  .legal-table-wrap > table.legal-table {
    display: table;
    min-width: 0;
  }

  .legal-article a,
  .legal-section a {
    color: inherit !important;
    text-decoration: none !important;
  }
}
