.section-intro__aside.guide-search {
  min-width: min(100%, 280px);
}

.support-quick {
  padding: 56px 0;
  background: var(--snow);
  border-bottom: 1px solid var(--line);
}

.support-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.support-quick-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.page-hero-tile img,
.page-hero-tile--featured img,
.support-quick-card img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.support-quick-card p {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.guides {
  background: linear-gradient(180deg, var(--paper) 0%, var(--snow) 100%);
}

.guides .section-intro--split {
  margin-bottom: 36px;
}

.guides-panel {
  padding: clamp(20px, 3vw, 28px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(26, 28, 27, 0.04),
    0 12px 40px rgba(26, 28, 27, 0.06);
}

.guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  margin-bottom: 22px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.guide-filter {
  flex: 1 1 auto;
  min-width: max-content;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.guide-filter:hover:not(.is-active) {
  color: var(--teal-deep);
  background: var(--teal-soft);
}

.guide-filter.is-active {
  color: var(--white);
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 100%);
  box-shadow: 0 4px 14px rgba(2, 114, 114, 0.28);
}

.guide-filter:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.guide-search {
  position: relative;
  width: min(100%, 380px);
  margin-left: auto;
}

.guide-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.guide-search::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  opacity: 0.45;
  background: currentColor;
  color: var(--ink-2);
  pointer-events: none;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.guide-search input {
  min-height: 48px;
  padding: 10px 16px 10px 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(26, 28, 27, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* auto, not 1fr. A fractional row track needs the grid's own height, and
     that height is the sum of the rows. WebKit never resolves the cycle and
     the Anleitungen block grows without a bound. */
  grid-auto-rows: auto;
  align-items: stretch;
  gap: 12px;
}

.guide-link {
  --guide-accent: var(--teal);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  /* Stretch equalizes cards in a row. height: 100% sizes the card from the
     row that the card itself is stretching, which is the other half of the
     WebKit runaway. */
  min-height: 7.5rem;
  padding: 16px 18px 16px 20px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition:
    border-color 0.22s var(--ease),
    background 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.guide-link::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--guide-accent);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.guide-link {
  position: relative;
  overflow: hidden;
}

.guide-link:hover::before,
.guide-link:focus-visible::before {
  opacity: 1;
}

.guide-link[data-category="inbetriebnahme"] {
  --guide-accent: var(--teal);
}

.guide-link[data-category="handhabung"] {
  --guide-accent: #3d6f8c;
}

.guide-link[data-category="wartung"] {
  --guide-accent: #b8862e;
}

.guide-link[data-category="scanner"] {
  --guide-accent: var(--teal-deep);
}

.guide-link[data-category="schnittstellen"] {
  --guide-accent: var(--datev-deep);
}

.guide-link-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.guide-link-cat {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--guide-accent);
  background: color-mix(in srgb, var(--guide-accent) 12%, transparent);
}

.guide-link-title {
  flex: 1;
  min-height: calc(2 * 1.4 * 0.96rem);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.guide-link-action {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-deep);
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.guide-link-action::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M17 7H9M17 7v8'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  transition: transform 0.2s var(--ease);
}

.guide-link:hover,
.guide-link:focus-visible {
  border-color: color-mix(in srgb, var(--guide-accent) 45%, var(--line));
  background: var(--white);
  box-shadow: 0 10px 28px rgba(26, 28, 27, 0.07);
  transform: translateY(-1px);
}

.guide-link:hover .guide-link-action,
.guide-link:focus-visible .guide-link-action {
  color: var(--white);
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

.guide-link:hover .guide-link-action::after,
.guide-link:focus-visible .guide-link-action::after {
  transform: translate(2px, -2px);
}

.guide-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.guide-link.is-hidden {
  display: none;
}

.guide-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.guide-pager[hidden] {
  display: none;
}

.guide-pager-status {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.guide-pager-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-pager-controls button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.guide-pager-controls button:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--teal-soft);
}

.guide-pager-controls button[aria-current="page"] {
  color: var(--white);
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 100%);
  border-color: transparent;
}

.guide-pager-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.guide-pager-controls button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.guides:has(+ .support-contact) {
  padding-bottom: 36px;
}

.support-contact {
  padding: 0 0 88px;
  background: var(--snow);
}

.support-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px 40px;
  padding: 28px 32px;
  background:
    linear-gradient(135deg, rgba(3, 154, 154, 0.08), transparent 42%),
    var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(26, 28, 27, 0.04),
    0 12px 40px rgba(26, 28, 27, 0.06);
}

.support-contact-card .eyebrow {
  margin-bottom: 8px;
}

.support-contact-card h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.support-contact-card p:last-child {
  margin: 10px 0 0;
  max-width: 38rem;
  color: var(--ink-2);
}

.support-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.part-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.part-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.part-media {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  max-height: 132px;
  flex-shrink: 0;
  background: var(--snow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.part-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 108px;
  object-fit: contain;
}

.part-media--zoom,
.part-media--zoom img {
  max-width: 100%;
  max-height: 108px;
}

.part-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
  background: var(--white);
}

.part-body h3 {
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0;
}

.part-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.part-includes {
  font-size: 0.72rem;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.part-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.part-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-deep);
  flex-shrink: 0;
  min-width: 0;
}

.part-price small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
}

.part-toggle {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: transparent;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.part-card.is-selected .part-toggle {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-deep);
}

.cart-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-md);
  padding: 22px;
}

.cart-panel h3 {
  color: #fff;
  margin: 0 0 6px;
}

.cart-panel .muted {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.62);
  margin: 0 0 18px;
}

.cart-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  min-height: 48px;
}

.cart-line {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.cart-line-thumb {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cart-line-thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-line-copy strong {
  display: block;
  color: #fff;
  font-size: 0.88rem;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.qty-stepper span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

.qty-stepper--light {
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.qty-stepper--light button {
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--snow);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.qty-stepper--light button:hover {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.qty-stepper--light button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-stepper--light span {
  min-width: 28px;
  font-weight: 600;
  color: var(--ink);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
}

.cart-total strong {
  font-size: 1.35rem;
  color: #fff;
}

.cart-empty {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

.checkout {
  background: var(--paper);
}

.checkout-shell {
  max-width: 820px;
}

.form-order {
  padding: 0;
  background: transparent;
  border: 0;
}

.form-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 16px;
}

.form-block-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-block-head h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.form-block-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

#parts-form .form-block > .btn {
  margin-top: 22px;
}

.order-empty-hint {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--snow);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--muted);
}

.order-empty-hint.is-hidden {
  display: none;
}

.order-lines {
  display: grid;
  gap: 10px;
  margin: 0;
}

.order-line {
  display: none;
  grid-template-columns: 64px minmax(0, 1fr) auto 88px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.order-line.is-visible {
  display: grid;
  min-width: 0;
}

.order-line-thumb {
  width: 64px;
  height: 64px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.order-line-thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.order-line-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-line-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.order-line-meta {
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.order-line-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.order-line-qty-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.order-line-sum {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal-deep);
  text-align: right;
}

.order-form-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.order-form-total strong {
  font-size: 1.35rem;
  color: var(--ink);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.checkout-aside {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.checkout-aside ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.order-line label {
  margin: 0;
}

.vat-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 12px;
}

@media (max-width: 980px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

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

  .guide-list,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .order-line.is-visible {
    grid-template-columns: 56px 1fr 1fr;
    grid-template-areas:
      "thumb details details"
      "thumb qty sum";
  }

  .order-line-thumb {
    grid-area: thumb;
    width: 56px;
    height: 56px;
  }

  .order-line-details {
    grid-area: details;
  }

  .order-line-qty {
    grid-area: qty;
  }

  .order-line-sum {
    grid-area: sum;
    text-align: left;
  }

  .support-quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cart-panel {
    position: static;
  }

  .guide-search {
    margin-left: 0;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .support-quick-grid {
    grid-template-columns: 1fr;
  }

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

  .guides-panel {
    padding: 16px;
    border-radius: 12px;
  }

  .guide-toolbar {
    flex-wrap: wrap;
    overflow: visible;
  }

  .guide-filter {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    min-width: 0;
  }

  .qty-stepper button {
    width: 44px;
    height: 44px;
  }

  .guide-link {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-height: 9.5rem;
  }

  .guide-link-action {
    width: 100%;
    justify-content: center;
    align-self: stretch;
    margin-top: auto;
  }

  .guide-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .support-contact-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }

  .support-contact-actions,
  .support-contact-actions .btn {
    width: 100%;
  }
}
