﻿/* Focused mobile composition for the existing homepage recommendation and profile panels. */
@media (max-width: 768px) {
  html body.page-forside #pageIntroPanel .home-primary-row,
  html body.page-forside #pageIntroPanel .home-secondary-row { gap: 14px; }
  html body.page-forside #pageIntroPanel .section-header { margin-bottom: 8px; }

  /* Keep the real "Se alle" link in the genre heading rather than leaving it
     on a separate row below the title. */
  html body.page-forside #pageIntroPanel .home-genres .section-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
  }
  html body.page-forside #pageIntroPanel .home-genres .section-header h2 {
    min-width: 0 !important;
    white-space: nowrap !important;
  }
  html body.page-forside #pageIntroPanel .home-genres__all-link {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    color: #a54822 !important;
    font: 800 .8rem/1 "Manrope", sans-serif !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 3px !important;
  }

  /* Authoritative mobile Profile composition. The base Profile skin stays in
     style.css; this file owns the dashboard's mobile structure. */
  html body.page-profil .profile-header--dashboard {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 8px 12px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  html body.page-profil .profile-header--dashboard .profile-avatar {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px !important;
  }

  html body.page-profil .profile-header--dashboard .profile-header__copy {
    min-width: 0 !important;
    align-self: center !important;
  }

  html body.page-profil .profile-header--dashboard .profile-email {
    margin: 2px 0 0 !important;
    color: #74695f !important;
    font-size: 0.74rem !important;
    font-weight: 560 !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
  }

  html body.page-profil .profile-header--dashboard .profile-header__intro {
    margin: 4px 0 0 !important;
    color: #74695f !important;
    font-size: 0.74rem !important;
    font-weight: 500 !important;
    line-height: 1.34 !important;
  }

  html body.page-profil .profile-header--dashboard .profile-header__copy h2 {
    margin-bottom: 3px !important;
    font-size: 1.38rem !important;
    font-weight: 850 !important;
  }

  html body.page-profil .profile-stats--overview {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  html body.page-profil .profile-stat-card--ratings,
  html body.page-profil .profile-stat-card--saved,
  html body.page-profil .profile-stat-card--suggestions {
    grid-column: span 2 !important;
    min-width: 0 !important;
    min-height: 86px !important;
    height: 86px !important;
    padding: 6px !important;
    display: grid !important;
    grid-template-rows: 20px minmax(0, 1fr) 15px !important;
    place-items: center !important;
    gap: 2px !important;
    border: 1px solid rgba(225, 207, 190, 0.84) !important;
    border-radius: 16px !important;
    background: rgba(255, 253, 249, 0.9) !important;
    box-shadow: 0 6px 16px rgba(76, 52, 30, 0.045) !important;
    text-align: center !important;
  }

  html body.page-profil .profile-stat-card--ratings::before,
  html body.page-profil .profile-stat-card--saved::before,
  html body.page-profil .profile-stat-card--suggestions::before {
    display: none !important;
    content: none !important;
  }

  html body.page-profil .profile-stat-card--ratings strong,
  html body.page-profil .profile-stat-card--saved strong,
  html body.page-profil .profile-stat-card--suggestions strong {
    margin: 0 !important;
    color: #171411 !important;
    font-size: clamp(1.25rem, 5.4vw, 1.35rem) !important;
    font-weight: 850 !important;
    line-height: 1 !important;
  }

  html body.page-profil .profile-stat-card--ratings .profile-stat-card__label,
  html body.page-profil .profile-stat-card--saved .profile-stat-card__label,
  html body.page-profil .profile-stat-card--suggestions .profile-stat-card__label {
    min-height: 0 !important;
    color: #4a4038 !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  html body.page-profil .profile-stat-card--ratings .profile-stat-card__label::after,
  html body.page-profil .profile-stat-card--saved .profile-stat-card__label::after,
  html body.page-profil .profile-stat-card--suggestions .profile-stat-card__label::after {
    display: none !important;
    content: none !important;
  }

  html body.page-profil .profile-stat-card--ratings .profile-stat-card__icon,
  html body.page-profil .profile-stat-card--saved .profile-stat-card__icon,
  html body.page-profil .profile-stat-card--suggestions .profile-stat-card__icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.9rem !important;
  }

  html body.page-profil .profile-stat-card--ratings .profile-stat-card__icon svg,
  html body.page-profil .profile-stat-card--saved .profile-stat-card__icon svg,
  html body.page-profil .profile-stat-card--suggestions .profile-stat-card__icon svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  html body.page-profil .profile-stat-card--saved .profile-stat-card__icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  html body.page-profil .profile-stat-card--genre,
  html body.page-profil .profile-stat-card--average {
    grid-column: span 3 !important;
    min-width: 0 !important;
    min-height: 78px !important;
    height: 78px !important;
    padding: 8px !important;
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 7px !important;
    row-gap: 3px !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    border: 1px solid rgba(225, 207, 190, 0.84) !important;
    border-radius: 16px !important;
    background: rgba(255, 253, 249, 0.9) !important;
    box-shadow: 0 6px 16px rgba(76, 52, 30, 0.045) !important;
    text-align: left !important;
  }

  html body.page-profil .profile-stat-card--genre::before,
  html body.page-profil .profile-stat-card--average::before {
    display: none !important;
    content: none !important;
  }

  html body.page-profil .profile-stat-card--genre .profile-stat-card__icon,
  html body.page-profil .profile-stat-card--average .profile-stat-card__icon {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: 26px !important;
    height: 26px !important;
    margin: 0 !important;
  }

  html body.page-profil .profile-stat-card--average .profile-stat-card__icon {
    width: 32px !important;
    height: 32px !important;
    color: #ff5c16 !important;
  }

  html body.page-profil .profile-stat-card--average {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    column-gap: 8px !important;
  }

  html body.page-profil .profile-stat-card--average .profile-stat-card__icon svg {
    width: 21px !important;
    height: 21px !important;
    fill: currentColor !important;
    stroke: none !important;
  }

  html body.page-profil .profile-stat-card--genre .profile-stat-card__label,
  html body.page-profil .profile-stat-card--average .profile-stat-card__label {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-height: 0 !important;
    color: #74695f !important;
    font-size: 0.48rem !important;
    font-weight: 850 !important;
    line-height: 1.12 !important;
    letter-spacing: 0.025em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    text-align: left !important;
  }

  html body.page-profil .profile-stat-card--genre .profile-stat-card__icon {
    background: transparent !important;
  }

  html body.page-profil .profile-stat-card--genre .profile-stat-card__icon svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linejoin: round !important;
  }

  html body.page-profil .profile-stat-card--genre .profile-stat-card__label::after,
  html body.page-profil .profile-stat-card--average .profile-stat-card__label::after {
    display: none !important;
    content: none !important;
  }

  html body.page-profil .profile-stat-card--genre strong,
  html body.page-profil .profile-stat-card--average strong {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #171411 !important;
    font-size: clamp(0.94rem, 4.1vw, 1.02rem) !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html body.page-profil .profile-header--dashboard .profile-header__edit {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 38px !important;
    margin-top: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    border: 1px solid rgba(255, 92, 22, 0.68) !important;
    border-radius: 999px !important;
    background: rgba(255, 253, 249, 0.72) !important;
    box-shadow: none !important;
    color: #d95017 !important;
    font-size: 0.9rem !important;
    font-weight: 780 !important;
    text-decoration: none !important;
  }

  html body.page-profil .profile-header--dashboard .profile-header__edit-icon {
    width: 17px !important;
    height: 17px !important;
    margin-right: 8px !important;
    display: inline-grid !important;
    place-items: center !important;
  }

  html body.page-profil .profile-header--dashboard .profile-header__edit-icon svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  html body.page-profil .profile-saved-panel {
    padding: 16px !important;
  }

  html body.page-profil .profile-saved-panel .profile-panel__header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  html body.page-profil .profile-saved-panel .profile-panel__header .profile-eyebrow {
    display: none !important;
  }

  html body.page-profil .profile-saved-panel .profile-panel__tools {
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 7px !important;
  }

  html body.page-profil .profile-saved-panel .profile-panel__toggle {
    min-height: 34px !important;
    padding: 0 11px !important;
    border-color: rgba(255, 92, 22, 0.38) !important;
    border-radius: 999px !important;
    background: rgba(255, 253, 249, 0.68) !important;
    color: #bd4515 !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* The existing saved-card component becomes the compact four-cover preview
     from the approved mobile Profile composition. */
  html body.page-profil .profile-saved-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body.page-profil .profile-saved-grid .profile-saved-empty {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 2px 0 !important;
    display: grid !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 5px !important;
    box-sizing: border-box !important;
  }

  html body.page-profil .profile-saved-grid .profile-saved-empty h2 {
    margin: 0 !important;
    color: #2b221d !important;
    font: 800 0.98rem / 1.15 "Manrope", sans-serif !important;
    white-space: nowrap;
  }

  html body.page-profil .profile-saved-grid .profile-saved-empty p {
    margin: 0 !important;
    color: #7a6d64 !important;
    font: 560 0.74rem / 1.35 "Manrope", sans-serif !important;
  }

  html body.page-profil .profile-saved-grid .saved-card {
    display: block !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html body.page-profil .profile-saved-grid .saved-card__cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 7px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 14px rgba(42, 28, 18, 0.1) !important;
  }

  html body.page-profil .profile-saved-grid .saved-card__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  html body.page-profil .profile-saved-grid .saved-card__copy h2 {
    margin: 0 !important;
    display: -webkit-box !important;
    overflow: hidden !important;
    color: #211a16 !important;
    font: 760 0.7rem / 1.2 "Manrope", sans-serif !important;
    text-align: center !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  html body.page-profil .profile-saved-grid .saved-card__copy p,
  html body.page-profil .profile-saved-grid .saved-card__date,
  html body.page-profil .profile-saved-grid .saved-card__scores,
  html body.page-profil .profile-saved-grid .saved-card__actions {
    display: none !important;
  }

  html body.page-profil #profileSuggestions.is-collapsed > .profile-suggest-button,
  html body.page-profil #profileSuggestions.is-collapsed > [data-profile-expand="suggestions"] {
    display: none !important;
  }

  html body.page-profil #profileSuggestions.is-collapsed > .profile-suggestion-list {
    display: grid !important;
  }

  html body.page-profil #profileSuggestions.is-collapsed > .profile-suggestion-list > :nth-child(n + 2) {
    display: none !important;
  }

  html body.page-profil .profile-saved-empty.profile-empty-state--compact,
  html body.page-profil .profile-ratings-panel .profile-empty-state--compact,
  html body.page-profil .profile-episode-ratings-panel .profile-empty-state--compact {
    min-height: 90px !important;
    padding: 14px !important;
    display: grid !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 5px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  html body.page-profil .profile-empty-state--compact h2,
  html body.page-profil .profile-empty-state--compact h3 {
    margin: 0 !important;
    color: #2b221d !important;
    font: 800 0.98rem / 1.15 "Manrope", sans-serif !important;
  }

  html body.page-profil .profile-empty-state--compact p {
    margin: 0 !important;
    color: #7a6d64 !important;
    font: 560 0.74rem / 1.35 "Manrope", sans-serif !important;
  }

  html body.page-profil #profileEpisodeRatings.is-collapsed > .profile-panel__note,
  html body.page-profil #profileEpisodeRatings.is-collapsed > .profile-episode-list,
  html body.page-profil #profileEpisodeRatings.is-collapsed > [data-profile-episode-ratings-more] {
    display: none !important;
  }

  html body.page-profil .profile-dashboard > #profileEpisodeRatings {
    display: block !important;
    grid-column: 1 / -1 !important;
  }

  html body.page-profil #profileEpisodeRatings .profile-panel__header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 6px !important;
  }

  html body.page-profil #profileEpisodeRatings .profile-panel__header h2 {
    font-size: 0.94rem !important;
    letter-spacing: -0.025em !important;
    white-space: nowrap;
  }

  html body.page-profil #profileEpisodeRatings .profile-panel__tools {
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }

  html body.page-profil #profileEpisodeRatings .profile-panel__toggle {
    min-height: 32px !important;
    padding: 0 8px !important;
    font-size: 0.7rem !important;
    white-space: nowrap !important;
  }
}

/* Keep the logged-out mobile profile invitation sized by its real content. */
@media (max-width: 768px) {
  html body.page-profil .profile-page--logged-out .profile-state-card--logged-out {
    min-height: 0 !important;
    align-content: start !important;
    padding-block: 18px !important;
    gap: 10px !important;
  }

  html body.page-profil .profile-page--logged-out .profile-mobile-titlebar {
    margin-bottom: 4px !important;
  }

  html body.page-profil .profile-page--logged-out .profile-mobile-titlebar h1 {
    font-size: clamp(2.35rem, 9.6vw, 2.65rem) !important;
    line-height: 0.98 !important;
  }

  html body.page-profil .profile-page--logged-out .profile-state-card--logged-out h2 {
    font-size: clamp(1.55rem, 6.9vw, 1.82rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.03em !important;
  }

  html body.page-profil .profile-page--logged-out .profile-state-card--logged-out > p:not(.profile-eyebrow) {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  html body.page-profil .profile-page--logged-out .profile-benefit-grid {
    gap: 8px !important;
    margin-block: 0 !important;
  }

  html body.page-profil .profile-page--logged-out .profile-benefit-card {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 2px 8px !important;
    padding-block: 8px !important;
    border-color: rgba(226, 213, 198, 0.72) !important;
  }

  html body.page-profil .profile-page--logged-out .profile-benefit-card__icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
  }

  html body.page-profil .profile-page--logged-out .profile-benefit-card strong {
    font-size: 0.84rem !important;
  }

  html body.page-profil .profile-page--logged-out .profile-benefit-card p {
    font-size: 0.71rem !important;
    line-height: 1.3 !important;
  }

  html body.page-profil .profile-page--logged-out .profile-actions {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    margin-top: 4px !important;
  }

  html body.page-profil .profile-page--logged-out .profile-button {
    min-height: 48px !important;
    height: 48px !important;
  }
}
