/* ═══════════════════════════════════════════════════════════════════════════
   DreamPage account dashboard components.
   Loaded ONLY on account pages (see inc/account.php) — must never affect
   cart, checkout, product or content pages.

   Base account styles (gate, nav, forms, buttons) live in site.css; this file
   adds the dashboard overview, book cards, progress bar/timeline, order rows,
   order detail view and empty states. Mobile-first.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout reset ────────────────────────────────────────────────────────────
   WooCommerce's classic stylesheet floats the nav/content and gives them
   30% / 68% widths — meant for its own two-column float layout. Ours is a
   CSS grid (.dp-account-layout), so those percentages shrink both columns
   (the nav card collapsed to 84px on desktop). Neutralize them. */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
  float: none;
  width: 100%;
  min-width: 0;
}

/* The logged-in dashboard is an app surface — the marketing footer below it
   is noise. The login/registration gate keeps the footer. */
body.logged-in.woocommerce-account .dp-footer {
  display: none;
}

/* ── Overview cards ──────────────────────────────────────────────────────── */
.dp-account-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}

.dp-account-overview__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(19, 36, 64, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 247, 255, 0.96) 100%);
  box-shadow: 0 12px 30px rgba(19, 36, 64, 0.04);
  text-decoration: none;
}

.dp-account-overview__card--support {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dp-account-overview__card--support:hover {
  transform: translateY(-2px);
  border-color: rgba(106, 90, 224, 0.24);
  box-shadow: 0 18px 38px rgba(91, 63, 214, 0.1);
}

.dp-account-overview__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(19, 36, 64, 0.52);
}

.dp-account-overview__value {
  font-family: "Poppins", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--dp-text);
}

.dp-account-overview__value--small {
  font-size: 1.05rem;
}

.dp-account-overview__hint {
  font-size: 0.82rem;
  color: rgba(19, 36, 64, 0.58);
}

/* The support email is the longest hint — keep it inside the card on the
   narrow two-column mobile grid. */
.dp-account-overview__card--support .dp-account-overview__hint {
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.dp-account-section {
  margin: 0 0 30px;
}

.dp-account-section:last-child {
  margin-bottom: 0;
}

.dp-account-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.dp-account-section__head h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dp-text);
}

.dp-account-section__link {
  flex-shrink: 0;
  color: var(--dp-accent-strong);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.dp-account-section__link:hover {
  text-decoration: underline;
}

/* ── Book / order cards ──────────────────────────────────────────────────── */
.dp-book-card-list {
  display: grid;
  gap: 14px;
}

.dp-book-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(19, 36, 64, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(19, 36, 64, 0.04);
}

.dp-book-card__media {
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(106, 90, 224, 0.1) 0%, rgba(94, 204, 255, 0.12) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-book-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dp-book-card__placeholder {
  color: rgba(106, 90, 224, 0.55);
  display: flex;
}

.dp-book-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-book-card__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dp-book-card__title {
  margin: 0;
  font-family: "Fredoka", "Poppins", sans-serif;
  font-size: 1.58rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--dp-text);
}

.dp-book-card__child {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(19, 36, 64, 0.62);
}

/* Now lives in the actions row, pushed to the right so it sits beside the
   "Se detaljer" button instead of stacking under the title. */
.dp-book-card__meta {
  margin: 0;
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
  font-size: 0.82rem;
  color: rgba(19, 36, 64, 0.56);
}

.dp-book-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

/* Apple "liquid glass" — same treatment as the site's primary CTAs
   (#preview-btn / .dp-hero-btn-primary): tinted translucent fill, frosted
   blur, specular top highlight, layered inset shadows. */
.woocommerce-account .dp-book-card__button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(135deg, rgba(106, 90, 224, 0.95), rgba(91, 63, 214, 0.97));
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow:
    0 8px 24px rgba(91, 63, 214, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(60, 42, 150, 0.3);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.woocommerce-account .dp-book-card__button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 44%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  opacity: 0.6;
  pointer-events: none;
}

.woocommerce-account .dp-book-card__button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 30px rgba(91, 63, 214, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(60, 42, 150, 0.3);
}

.woocommerce-account .dp-book-card__button:active {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.98);
}

.dp-book-card__support {
  color: var(--dp-accent-strong);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.dp-book-card__support:hover {
  text-decoration: underline;
}

/* ── Progress bar (compact) ──────────────────────────────────────────────── */
.dp-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dp-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dp-progress__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dp-text);
}

.dp-progress__percent {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--dp-text);
  font-variant-numeric: tabular-nums;
}

.dp-progress__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(19, 36, 64, 0.07);
  overflow: hidden;
}

.dp-progress__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dp-accent-strong) 0%, var(--dp-accent) 100%);
  box-shadow: 0 1px 5px rgba(91, 63, 214, 0.35);
}

.dp-progress__next {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(19, 36, 64, 0.56);
}

.dp-progress__terminal {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #b0413e;
}

/* ── Step timeline (order detail) ────────────────────────────────────────── */
.dp-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dp-timeline__step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 22px 0;
}

.dp-timeline__step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: rgba(19, 36, 64, 0.1);
}

.dp-timeline__step:last-child {
  padding-bottom: 0;
}

.dp-timeline__step:last-child::before {
  display: none;
}

.dp-timeline__marker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(19, 36, 64, 0.16);
  background: #fff;
  color: #fff;
  z-index: 1;
}

.dp-timeline__step--done .dp-timeline__marker {
  border-color: var(--dp-accent-strong);
  background: var(--dp-accent-strong);
}

.dp-timeline__step--current .dp-timeline__marker {
  border-color: var(--dp-accent-strong);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(106, 90, 224, 0.14);
}

.dp-timeline__step--current .dp-timeline__marker::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dp-accent-strong);
}

.dp-timeline__step--done::before {
  background: var(--dp-accent-strong);
}

.dp-timeline__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 3px;
}

.dp-timeline__label {
  font-size: 0.96rem;
  font-weight: 600;
  color: rgba(19, 36, 64, 0.55);
}

.dp-timeline__step--done .dp-timeline__label,
.dp-timeline__step--current .dp-timeline__label {
  color: var(--dp-text);
}

.dp-timeline__step--current .dp-timeline__label {
  font-weight: 700;
}

.dp-timeline__note {
  font-size: 0.86rem;
  line-height: 1.6;
  color: rgba(19, 36, 64, 0.62);
}

.dp-timeline--terminal {
  padding: 18px;
  border: 1px solid rgba(176, 65, 62, 0.25);
  border-radius: 16px;
  background: rgba(176, 65, 62, 0.05);
}

.dp-timeline__terminal-label {
  margin: 0 0 6px;
  font-weight: 700;
  color: #b0413e;
}

.dp-timeline__terminal-note {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(19, 36, 64, 0.7);
}

.dp-timeline__terminal-note a {
  color: var(--dp-accent-strong);
  font-weight: 600;
}

/* ── Order history rows (dashboard) ──────────────────────────────────────── */
.dp-order-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(19, 36, 64, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  overflow: hidden;
}

.dp-order-rows__item + .dp-order-rows__item {
  border-top: 1px solid rgba(19, 36, 64, 0.07);
}

.dp-order-rows__link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 18px;
  text-decoration: none;
  transition: background-color 0.16s ease;
}

.dp-order-rows__link:hover {
  background: rgba(106, 90, 224, 0.05);
}

.dp-order-rows__number {
  font-weight: 700;
  color: var(--dp-text);
}

.dp-order-rows__date {
  font-size: 0.84rem;
  color: rgba(19, 36, 64, 0.56);
  text-align: right;
}

.dp-order-rows__status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dp-accent-strong);
}

.dp-order-rows__status--cancelled,
.dp-order-rows__status--refunded,
.dp-order-rows__status--failed {
  color: #b0413e;
}

.dp-order-rows__total {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(19, 36, 64, 0.72);
  text-align: right;
}

/* ── Empty states ────────────────────────────────────────────────────────── */
.dp-account-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  border: 1.5px dashed rgba(19, 36, 64, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.dp-account-empty--soft {
  padding: 26px 22px;
}

.dp-account-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(106, 90, 224, 0.1);
  color: var(--dp-accent-strong);
}

.dp-account-empty__title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--dp-text);
}

.dp-account-empty__copy {
  margin: 0;
  max-width: 360px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(19, 36, 64, 0.62);
}

.woocommerce-account .dp-account-empty__cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 10px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--dp-accent-strong);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.woocommerce-account .dp-account-empty__cta:hover {
  background: var(--dp-accent);
  transform: translateY(-1px);
}

/* ── Orders endpoint ─────────────────────────────────────────────────────── */
.dp-account-orders__head {
  margin-bottom: 18px;
}

.dp-account-orders__head h2 {
  margin: 0 0 4px;
}

.dp-account-orders__head p {
  margin: 0;
  color: rgba(19, 36, 64, 0.62);
}

.dp-account-orders__pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.woocommerce-account .dp-account-orders__page-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(19, 36, 64, 0.12);
  border-radius: 12px;
  background: #fff;
  color: var(--dp-text);
  font-weight: 600;
  text-decoration: none;
}

.woocommerce-account .dp-account-orders__page-link:hover {
  border-color: rgba(106, 90, 224, 0.3);
  color: var(--dp-accent-strong);
}

/* ── Order detail (view-order) ───────────────────────────────────────────── */
.dp-view-order__head {
  margin-bottom: 20px;
}

.dp-view-order__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(19, 36, 64, 0.52);
}

.dp-view-order__title {
  margin: 0 0 6px;
}

.dp-view-order__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: rgba(19, 36, 64, 0.62);
  font-size: 0.94rem;
}

.dp-view-order__status {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(106, 90, 224, 0.1);
  color: var(--dp-accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.dp-view-order__status--cancelled,
.dp-view-order__status--refunded,
.dp-view-order__status--failed {
  background: rgba(176, 65, 62, 0.08);
  color: #b0413e;
}

.dp-view-order__books {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.dp-view-order__book {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(19, 36, 64, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
}

.dp-view-order__book-image {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.dp-view-order__book-title {
  display: block;
  color: var(--dp-text);
}

.dp-view-order__book-child {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--dp-accent-strong);
}

.dp-view-order__progress {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid rgba(19, 36, 64, 0.09);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 247, 255, 0.96) 100%);
}

.dp-view-order__progress h3 {
  margin: 0 0 18px;
}

.dp-tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(106, 90, 224, 0.18);
  border-radius: 16px;
  background: rgba(106, 90, 224, 0.06);
}

.dp-tracking__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dp-tracking__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(19, 36, 64, 0.55);
}

.dp-tracking__value {
  font-size: 0.94rem;
  color: var(--dp-text);
  word-break: break-all;
}

.woocommerce-account .dp-tracking__button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--dp-accent-strong);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.woocommerce-account .dp-tracking__button:hover {
  background: var(--dp-accent);
  transform: translateY(-1px);
}

.dp-view-order__support {
  margin: 18px 0 0;
  font-size: 0.88rem;
  color: rgba(19, 36, 64, 0.62);
}

.dp-view-order__support a {
  color: var(--dp-accent-strong);
  font-weight: 600;
}

.dp-view-order__notes {
  margin-bottom: 26px;
}

.dp-view-order__note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dp-view-order__note {
  padding: 14px 16px;
  border: 1px solid rgba(19, 36, 64, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
}

.dp-view-order__note + .dp-view-order__note {
  margin-top: 10px;
}

.dp-view-order__note .meta {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: rgba(19, 36, 64, 0.52);
}

.dp-view-order__note .description p {
  margin: 0;
  font-size: 0.92rem;
}

.dp-view-order__back {
  margin: 20px 0 0;
}

.dp-view-order__back a {
  color: var(--dp-accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.dp-view-order__back a:hover {
  text-decoration: underline;
}

/* ── Form submit buttons (WooCommerce's grey default loses to the brand) ─── */
.woocommerce-account .woocommerce-MyAccount-content button.button,
.woocommerce-account .woocommerce-MyAccount-content button.woocommerce-Button,
.woocommerce-account .woocommerce-MyAccount-content button[type="submit"] {
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: var(--dp-accent-strong);
  color: #fff;
  font-weight: 600;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.woocommerce-account .woocommerce-MyAccount-content button.button:hover,
.woocommerce-account .woocommerce-MyAccount-content button.woocommerce-Button:hover,
.woocommerce-account .woocommerce-MyAccount-content button[type="submit"]:hover {
  background: var(--dp-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* Logout and nav items must never wrap to two lines (also fixes desktop). */
.woocommerce-account .dp-account-dashboard__logout,
.woocommerce-account .dp-account-nav a {
  white-space: nowrap;
}

/* ── Nav support block ───────────────────────────────────────────────────── */
.dp-account-nav__support {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(106, 90, 224, 0.06);
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.dp-account-nav__support:hover {
  background: rgba(106, 90, 224, 0.1);
}

.dp-account-nav__support-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dp-text);
}

.dp-account-nav__support-email {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dp-accent-strong);
  word-break: break-all;
}

/* ── Wider screens ───────────────────────────────────────────────────────── */
@media (min-width: 750px) {
  .dp-account-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .dp-book-card {
    padding: 20px;
  }

  .dp-book-card__media {
    width: 116px;
    height: 116px;
  }

  .dp-order-rows__link {
    grid-template-columns: 90px 1fr auto auto;
    gap: 14px;
  }

  .dp-order-rows__date {
    text-align: left;
  }
}

@media (max-width: 749px) {
  .dp-order-rows__link {
    grid-template-columns: 1fr auto;
  }

  .dp-order-rows__status {
    grid-column: 1;
  }

  .dp-order-rows__total {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile premium layer (≤989px, logged-in account pages).
   The page hero and the big nav card waste the whole first viewport on
   phones — replace them with a slim horizontal pill nav and let the
   dashboard content lead. Login/registration keeps its hero.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 989px) {
  /* 1. The page hero ("Min konto" + intro) duplicates the dashboard header —
        hide it for logged-in users only. */
  body.logged-in.woocommerce-account .dp-page-hero--account {
    display: none;
  }

  /* 2. Nav card → slim horizontal pill bar. */
  body.logged-in.woocommerce-account .dp-account-nav__card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  body.logged-in.woocommerce-account .dp-account-nav__user-row,
  body.logged-in.woocommerce-account .dp-account-nav__eyebrow,
  body.logged-in.woocommerce-account .dp-account-nav__divider,
  body.logged-in.woocommerce-account .dp-account-nav__support {
    display: none;
  }

  body.logged-in.woocommerce-account .dp-account-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.logged-in.woocommerce-account .dp-account-nav ul::-webkit-scrollbar {
    display: none;
  }

  body.logged-in.woocommerce-account .dp-account-nav a {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(19, 36, 64, 0.12);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 243, 255, 0.5) 100%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    box-shadow: 0 4px 12px rgba(19, 36, 64, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    color: rgba(19, 36, 64, 0.78);
    font-size: 0.88rem;
    white-space: nowrap;
  }

  body.logged-in.woocommerce-account .dp-account-nav li.is-active a {
    border-color: rgba(91, 63, 214, 0.4);
    background: linear-gradient(135deg, rgba(112, 96, 232, 0.95) 0%, rgba(91, 63, 214, 0.95) 100%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    color: #fff;
    /* Same soft drop shadow as the inactive pills — the larger purple glow
       bled past the scroll-fade and looked like a line at the rail edge. */
    box-shadow: 0 4px 12px rgba(19, 36, 64, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }

  /* Swipe affordance: fade the bar out at the right edge and nudge the
     pills once on load so the horizontal scroll is discoverable. */
  body.logged-in.woocommerce-account .dp-account-nav__card {
    position: relative;
    /* Neutralize the desktop sticky offset (top: 112px) — relative
       positioning honours `top` and shifted the whole bar down. */
    top: 0;
  }

  body.logged-in.woocommerce-account .dp-account-nav__card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 10px;
    width: 42px;
    background: linear-gradient(90deg, rgba(251, 250, 247, 0) 0%, var(--dp-bg) 92%);
    pointer-events: none;
  }

  body.logged-in.woocommerce-account .dp-account-nav li {
    animation: dp-nav-swipe-hint 1.7s ease-out 0.7s 1;
  }

  /* 3. Let dashboard/orders/order pages sit flat on the page background —
        their inner cards carry the design. Forms (kontodetaljer, adresser)
        keep the white content card. */
  .woocommerce-account .dp-account-content:has(.dp-account-dashboard),
  .woocommerce-account .dp-account-content:has(.dp-account-orders),
  .woocommerce-account .dp-account-content:has(.dp-view-order) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .dp-account-layout {
    gap: 6px;
  }

  /* 4. Compact dashboard header: "Hei, Nora" + slim logout pill on one row;
        the intro sentence is noise on a phone. */
  .woocommerce-account .dp-account-dashboard__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .dp-account-dashboard__header p {
    display: none;
  }

  .woocommerce-account .dp-account-dashboard__header h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dp-account-dashboard__header > div {
    min-width: 0;
  }

  .dp-account-dashboard__eyebrow {
    margin-bottom: 4px;
  }

  .woocommerce-account .dp-account-dashboard__logout {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    justify-content: center;
  }

  /* 5. Tighter cards. */
  .dp-account-overview {
    gap: 10px;
    margin-bottom: 24px;
  }

  .dp-account-overview__card {
    padding: 14px;
    border-radius: 16px;
  }

  .dp-account-overview__value {
    font-size: 1.35rem;
  }

  .dp-account-overview__value--small {
    font-size: 0.98rem;
  }

  /* Support email is the longest hint — shrink it so it stays on one line
     inside the narrow card on phones (Poppins is wider than it looks). */
  .dp-account-overview__card--support .dp-account-overview__hint {
    font-size: 0.62rem;
  }

  /* Image on the right so the text column starts flush at the card's left
     edge — title, child name, progress and actions align on one axis. */
  .dp-book-card {
    position: relative;
    flex-direction: row-reverse;
    align-items: flex-start;
    padding: 14px;
    gap: 14px;
    border-radius: 18px;
  }

  .dp-book-card__media {
    width: 100px;
    height: 100px;
    border-radius: 14px;
  }

  /* Tighter vertical rhythm inside the card on phones — the desktop gaps
     leave too much air between title, progress and actions. */
  .dp-book-card__body {
    gap: 6px;
  }

  .dp-book-card__header {
    gap: 1px;
  }

  .dp-book-card__actions {
    gap: 8px 10px;
  }

  /* Pin the order line to the card's bottom-right corner (the empty room
     under the image), level with the "Se detaljer" button — instead of
     letting it wrap underneath the button in the narrow body column. */
  .dp-book-card__meta {
    position: absolute;
    right: 14px;
    bottom: 8px;
    margin: 0;
    font-size: 0.8rem;
  }

  .dp-account-section {
    margin-bottom: 26px;
  }

  .dp-view-order__progress {
    padding: 18px 16px;
  }

  .dp-account-orders__head h2 {
    margin-bottom: 2px;
  }
}

/* One-time horizontal peek of the nav pills (mobile swipe hint). */
@keyframes dp-nav-swipe-hint {
  0%,
  55% {
    transform: translateX(0);
  }
  72% {
    transform: translateX(-26px);
  }
  86% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.logged-in.woocommerce-account .dp-account-nav li {
    animation: none;
  }
}

/* ── Honest delivery estimate ─────────────────────────────────────────── */
.dp-delivery-estimate {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid rgba(19, 36, 64, 0.09);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 247, 255, 0.96) 100%);
}

.dp-delivery-estimate__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 18px;
}

.dp-delivery-estimate__head h3 {
  margin: 0;
}

.dp-delivery-estimate__window {
  font-weight: 700;
  color: var(--dp-accent-strong);
  font-size: 1.02rem;
  white-space: nowrap;
}

.dp-delivery-estimate__phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.dp-delivery-estimate__phase {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dp-delivery-estimate__num {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(106, 90, 224, 0.12);
  color: var(--dp-accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.dp-delivery-estimate__phase-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dp-delivery-estimate__phase-label {
  font-weight: 600;
  color: var(--dp-text);
}

.dp-delivery-estimate__phase-time {
  margin-left: 8px;
  font-weight: 600;
  color: var(--dp-accent-strong);
  font-size: 0.9rem;
}

.dp-delivery-estimate__phase-note {
  color: rgba(19, 36, 64, 0.62);
  font-size: 0.9rem;
  line-height: 1.4;
}

.dp-delivery-estimate__disclaimer {
  margin: 16px 0 0;
  color: rgba(19, 36, 64, 0.5);
  font-size: 0.82rem;
  line-height: 1.45;
}
