.customer-portal-page main.customer-main {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding-top: calc(58px + var(--nav-h) + env(safe-area-inset-top));
  padding-bottom: 52px;
  display: grid;
  gap: 16px;
}

.customer-card,
.customer-portal-hero {
  border: 1px solid rgba(17, 19, 24, 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 253, 0.92) 100%);
  box-shadow: 0 18px 38px rgba(17, 19, 24, 0.07);
  padding: 18px;
}

.customer-portal-page [hidden] {
  display: none !important;
}

.customer-portal-hero {
  text-align: center;
}

.customer-portal-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 19, 24, 0.6);
}

.customer-portal-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.customer-portal-hero p {
  margin: 10px auto 0;
  max-width: 70ch;
  color: rgba(17, 19, 24, 0.72);
}

/* Hero Icon-Buttons (User + Logout) */
.cp-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.cp-hero-actions .customer-logout-form {
  margin: 0;
}

.cp-icon-btn {
  appearance: none;
  border: 1px solid rgba(17, 19, 24, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
}

.cp-icon-btn:hover,
.cp-icon-btn:focus-visible {
  border-color: rgba(17, 19, 24, 0.34);
  background: #f3f6fa;
}

.cp-icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.customer-pill {
  appearance: none;
  border: 1px solid rgba(17, 19, 24, 0.18);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  background: #f4f6fa;
  color: #111318;
  cursor: pointer;
}

.customer-pill:hover,
.customer-pill:focus-visible {
  border-color: rgba(17, 19, 24, 0.32);
}

.customer-pill--dark {
  background: #111318;
  border-color: #111318;
  color: #fff;
}

.customer-pill--ghost {
  background: rgba(255, 255, 255, 0.75);
}

.customer-logout-form {
  margin: 14px 0 0;
}

.customer-flash {
  margin: 0;
  border: 1px solid rgba(17, 19, 24, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
}

.customer-flash.success {
  background: #eaf8ef;
  color: #155937;
}

.customer-flash.error {
  background: #ffeef1;
  color: #8b1028;
}

.customer-login-hint h2,
.customer-card h3 {
  margin: 0;
}

.customer-login-hint p,
.customer-card > p {
  margin: 10px 0 0;
}

.customer-inline-login,
.customer-issue-form {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.customer-inline-login label,
.customer-issue-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.customer-inline-login input,
.customer-issue-form input,
.customer-issue-form select,
.customer-issue-form textarea {
  width: 100%;
  border: 1px solid rgba(17, 19, 24, 0.18);
  border-radius: 14px;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #111318;
}

.customer-inline-forgot-link {
  justify-self: center;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.2;
  color: rgba(17, 19, 24, 0.62);
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 19, 24, 0.28);
}

.customer-inline-forgot-link:hover,
.customer-inline-forgot-link:focus-visible {
  color: rgba(17, 19, 24, 0.82);
  border-bottom-color: rgba(17, 19, 24, 0.46);
}

.customer-issue-form textarea {
  resize: vertical;
  min-height: 130px;
}

/* Checkbox-Label: Telefonnummer */
.customer-inline-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
}

.customer-inline-check input[type="checkbox"] {
  appearance: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  margin-top: 2px;
}

.customer-inline-check > span {
  flex: 1;
  line-height: 1.45;
}

/* Bike-Galerie */
.customer-gallery {
  display: grid;
  gap: 14px;
}

.customer-gallery-figure {
  margin: 0;
  border-radius: 20px;
  border: 1px solid rgba(17, 19, 24, 0.12);
  background: #f7f8fb;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.customer-gallery-figure img {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Pfeil-Navigation unter dem Bild – nur auf Desktop sichtbar */
.customer-gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.customer-nav-btn {
  appearance: none;
  border: 1px solid rgba(17, 19, 24, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: rgba(17, 19, 24, 0.85);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.customer-gallery-meta {
  display: grid;
  gap: 4px;
}

.customer-gallery-meta .customer-bike-brand {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(17, 19, 24, 0.58);
}

.customer-gallery-meta h2 {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 34px);
}

.customer-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.customer-thumb-btn {
  border: 1px solid rgba(17, 19, 24, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #111318;
}

.customer-thumb-btn.is-active {
  border-color: rgba(17, 19, 24, 0.44);
  background: #f3f6fa;
}

.customer-thumb-btn img {
  width: 42px;
  height: 28px;
  object-fit: contain;
}

.customer-thumb-btn span {
  font-size: 14px;
  font-weight: 700;
}

/* Grid für Kaufdaten / Wartung / Service */
.customer-portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}


/* Ausklappbare Karten */
.customer-collapse-card {
  display: flex;
  flex-direction: column;
}

.customer-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.customer-collapse-header h3 {
  margin: 0;
  flex: 1;
}

.customer-collapse-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: rgba(17, 19, 24, 0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111318' stroke-opacity='.5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 6px;
  transition: transform 0.22s ease, background-color 0.15s;
  transform-origin: center center;
  font-size: 0;
}

.customer-collapse-header:hover .customer-collapse-arrow,
.customer-collapse-header:focus-visible .customer-collapse-arrow {
  background-color: rgba(17, 19, 24, 0.1);
}

.customer-collapse-card.is-open .customer-collapse-arrow {
  transform: rotate(180deg);
}

.customer-collapse-body {
  margin-top: 12px;
}

.customer-collapse-body[hidden] {
  display: none;
}

/* Rechnung-Button immer sichtbar, unterhalb des Headers */
.customer-invoice-btn {
  margin-top: 12px;
  align-self: flex-start;
}

.customer-keyvals {
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}

.customer-keyvals div {
  border: 1px solid rgba(17, 19, 24, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px 12px;
}

.customer-keyvals dt {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(17, 19, 24, 0.56);
}

.customer-keyvals dd {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.customer-note {
  font-size: 14px;
  color: rgba(17, 19, 24, 0.64);
  margin: 0;
}

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

.customer-list li {
  border: 1px solid rgba(17, 19, 24, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-list li span {
  font-weight: 600;
}

.customer-list a {
  text-decoration: none;
  color: #111318;
  border-bottom: 1px solid rgba(17, 19, 24, 0.4);
}

.customer-service-done {
  color: #155937;
  font-weight: 700;
}

.customer-list li.is-done {
  border-color: rgba(21, 89, 55, 0.24);
  background: rgba(234, 248, 239, 0.7);
}

.customer-form-feedback {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.customer-form-feedback.success {
  color: #145937;
}

.customer-form-feedback.error {
  color: #8b1028;
}

/* ── Profil-Modal ───────────────────────────────────────────────── */
.cp-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  padding: max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
}

.cp-profile-modal[hidden] {
  display: none;
}

.cp-profile-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 16, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cp-profile-modal__dialog {
  position: relative;
  width: min(480px, calc(100vw - 26px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(17, 19, 24, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 253, 0.96) 100%);
  box-shadow: 0 24px 64px rgba(10, 14, 22, 0.34);
  padding: 18px;
}

.cp-profile-modal__close {
  appearance: none;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(17, 19, 24, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: rgba(17, 19, 24, 0.84);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-profile-modal__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(17, 19, 24, 0.6);
}

.cp-profile-modal__dialog h2 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.06;
}

.cp-profile-form {
  display: grid;
  gap: 14px;
}

.cp-profile-fieldset {
  border: 1px solid rgba(17, 19, 24, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.cp-profile-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17, 19, 24, 0.56);
}

.cp-profile-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: rgba(17, 19, 24, 0.44);
}

.cp-profile-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.cp-profile-form input {
  width: 100%;
  border: 1px solid rgba(17, 19, 24, 0.18);
  border-radius: 13px;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #111318;
}

.cp-profile-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .customer-portal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .customer-portal-page main.customer-main {
    width: min(1100px, calc(100% - 18px));
  }

  .customer-card,
  .customer-portal-hero {
    border-radius: 18px;
    padding: 14px;
  }

  .customer-gallery-figure {
    min-height: 200px;
  }

  /* Pfeile auf Mobile ausblenden – Swipe reicht */
  .customer-gallery-nav {
    display: none;
  }
}
