/* ==========================================================================
   MA BIBLIOTHÈQUE DE RECETTES — RESPONSIVE V35
   Adaptations desktop, tablette, mobile, accessibilité et impression.
   Cette feuille est chargée après styles.css. L’ordre historique des blocs
   et des déclarations est conservé.
   ========================================================================== */

@media (min-width:761px) {
    .hero {
        padding: 22px 0 20px;
    }

    .hero-card {
        min-height: 285px;
    }

    .hero-content {
        padding: 34px 46px;
        max-width: 570px;
    }

    .hero h1 {
        font-size: clamp(32px, 3.8vw, 48px);
        margin: 10px 0;
    }

    .hero p {
        line-height: 1.6;
        margin: 10px 0 16px;
    }

    .daily-dish {
        margin-bottom: 22px;
        grid-template-columns: minmax(0, 1.8fr) minmax(220px, .95fr);
        align-items: stretch;
    }

    .daily-dish-copy {
        padding: 26px 30px;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .daily-dish-title {
        font-size: clamp(23px, 2.2vw, 29px);
        margin: 6px 0 8px;
        line-height: 1.14;
    }

    .daily-dish-description {
        line-height: 1.5;
        margin: 0 0 12px;
    }

    .daily-dish-meta {
        margin: 0 0 13px;
    }

    .daily-dish-kicker {
        margin-bottom: 2px;
    }

    .daily-dish-photo-wrap {
        height: 250px;
        min-height: 0;
        align-self: stretch;
    }

    .daily-dish-photo {
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }

    .topbar {
        min-height: 104px;
        height: 104px;
        flex-basis: 104px;
    }

    .brand {
        gap: 16px;
    }

    .brand-mark {
        width: 76px;
        height: 76px;
        flex: 0 0 76px;
        border-radius: 19px;
    }

    body[data-page="home"] #homePage {
        gap: 18px;
    }

    body[data-page="home"] #homePage .hero-card {
        height: 225px;
        min-height: 225px;
    }

    body[data-page="home"] #homePage .daily-dish {
        height: 220px;
        min-height: 220px;
    }

    body[data-page="home"] #homePage .daily-dish-photo-wrap,
  body[data-page="home"] #homePage .daily-dish-photo {
        height: 220px;
        min-height: 220px;
    }

    body[data-page="recipes"] #recipesPage .search-wrap {
        width: 50%;
        max-width: 50%;
        min-width: 0;
    }

    body[data-page="recipes"] #recipesPage .search-box {
        min-width: 0;
        flex: 1 1 auto;
    }

    html,
  body {
        background-color: #78866c;
        background-image: none;
        background-attachment: scroll;
        background-repeat: no-repeat;
    }

    body {
        background: #78866c;
    }

    #appMain,
  #appMain > .page-layout,
  #appMain .page-content,
  .page-view,
  #homePage,
  #recipesPage {
        background: transparent;
    }
}

@media (min-width:1051px) and (max-height:760px) {
    .page-layout:has(#homePage:not([hidden])) .sidebar .side-card {
        padding: 9px 14px;
        margin-bottom: 7px;
    }
}

@media (min-width:1051px) and (min-height:650px) {
    html, body {
        min-height: 100%;
    }

    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .topbar {
        flex: 0 0 82px;
    }

    #appMain {
        flex: 1 0 auto;
        min-height: calc(100vh - 82px);
        display: flex;
        flex-direction: column;
    }

    #appMain .page-layout {
        flex: 1 0 auto;
        min-height: 0;
        align-items: stretch;
        padding-top: 16px;
        padding-bottom: 8px;
    }

    #appMain .page-content {
        min-height: 0;
    }

    #homePage .hero {
        display: flex;
        padding: 0;
    }

    #homePage .hero-card {
        flex: 1 1 auto;
        height: auto;
    }

    #homePage .daily-dish {
        margin: 0;
    }

    #homePage .daily-dish-copy {
        justify-content: center;
    }

    #homePage .daily-dish-title {
        font-size: clamp(27px, 2.25vw, 36px);
        margin: 10px 0 12px;
    }

    #homePage .daily-dish-description {
        font-size: 14px;
        line-height: 1.65;
        margin-bottom: 16px;
    }

    #homePage .daily-dish-meta {
        margin-bottom: 16px;
    }

    .page-layout:has(#homePage:not([hidden])) .sidebar {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 16px;
    }

    .page-layout:has(#homePage:not([hidden])) .sidebar .side-card {
        flex: 0 0 auto;
        margin: 0;
        padding: 20px;
    }
}

@media (min-width:1051px) and (min-height:760px) {
    body[data-page="home"] #appMain .page-layout {
        min-height: calc(100vh - 190px);
    }
}

@media (min-width:1051px) {
    #appMain .page-layout {
        padding-top: 12px;
        gap: 24px;
        flex: 1 0 auto;
    }

    #homePage .hero {
        padding: 0 0 12px;
    }

    #homePage .hero h1 {
        font-size: clamp(30px, 3vw, 42px);
        margin: 8px 0;
    }

    #homePage .hero p {
        font-size: 13px;
        line-height: 1.5;
        margin: 7px 0 12px;
    }

    #homePage .daily-dish {
        margin: 0;
    }

    #homePage .daily-dish-photo-wrap {
        min-height: 0;
    }

    #homePage .daily-dish-photo {
        min-height: 0;
    }

    .page-layout:has(#homePage:not([hidden])) .sidebar .side-card {
        padding: 20px;
        margin-bottom: 0;
    }

    .page-layout:has(#homePage:not([hidden])) .sidebar .side-title {
        margin-bottom: 14px;
        font-size: 19px;
    }

    .page-layout:has(#homePage:not([hidden])) .sidebar .quick-action {
        padding: 7px 0;
    }

    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }

    .topbar {
        flex: 0 0 100px;
        height: 100px;
        min-height: 100px;
    }

    #appMain {
        flex: 1 0 auto;
        min-height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
    }

    #appMain > .page-layout {
        flex: 1 0 auto;
        min-height: 0;
        padding-top: 14px;
        padding-bottom: 0;
        gap: 24px;
    }

    body[data-page="home"] #appMain > .page-layout {
        align-items: stretch;
        height: auto;
        min-height: 0;
        flex: 1 1 0;
        padding-top: 14px;
        padding-bottom: 0;
        gap: 24px;
        overflow: visible;
    }

    body[data-page="home"] #homePage {
        display: grid;
        gap: 18px;
        grid-template-rows: minmax(0, 0.95fr) minmax(0, 1.05fr);
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    body[data-page="home"] #homePage .hero {
        padding: 0;
        margin: 0;
        height: 100%;
        min-height: 0;
    }

    body[data-page="home"] #homePage .hero-card {
        height: 100%;
        min-height: 0;
        width: 100%;
    }

    body[data-page="home"] #homePage .hero-content {
        padding: 20px 34px;
    }

    body[data-page="home"] #homePage .daily-dish {
        height: 100%;
        min-height: 0;
        grid-template-columns: minmax(0, 1.65fr) minmax(240px, 0.9fr);
        margin: 0;
        overflow: hidden;
        width: 100%;
    }

    body[data-page="home"] #homePage .daily-dish-copy,
  body[data-page="home"] #homePage .daily-dish-photo-wrap,
  body[data-page="home"] #homePage .daily-dish-photo {
        height: 100%;
        min-height: 0;
    }

    body[data-page="home"] #homePage .daily-dish-copy {
        padding: 14px 24px;
        overflow: visible;
        height: 100%;
        min-height: 0;
        justify-content: center;
    }

    body[data-page="home"] #homePage .daily-dish-title {
        font-size: clamp(21px, 1.65vw, 27px);
        line-height: 1.12;
        margin: 5px 0 7px;
    }

    body[data-page="home"] #homePage .daily-dish-description {
        font-size: 12px;
        line-height: 1.38;
        margin: 0 0 7px;
    }

    body[data-page="home"] #homePage .daily-dish-meta {
        margin: 0 0 7px;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 16px;
        padding-top: 0;
        height: auto;
    }

    .sidebar > .side-card {
        box-sizing: border-box;
        width: 100%;
        flex: 0 0 auto;
        margin: 0;
        padding: 20px;
    }

    .sidebar > .side-card:nth-child(1) {
        height: 174px;
        min-height: 174px;
    }

    .sidebar > .quick-access-card {
        height: 258px;
        min-height: 258px;
    }

    .sidebar .side-title {
        margin: 0 0 14px;
        font-size: 19px;
        line-height: 1.25;
    }

    .sidebar .quick-action {
        min-height: 57px;
        height: 57px;
        padding: 7px 0;
        box-sizing: border-box;
    }

    body[data-page="home"] {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body[data-page="home"] > .topbar {
        height: 100px;
        min-height: 100px;
        flex: 0 0 100px;
    }

    body[data-page="home"] #appMain {
        height: auto;
        min-height: 0;
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body[data-page="home"] #appMain .page-content,
  body[data-page="home"] #homePage {
        height: 100%;
        min-height: 0;
    }

    body[data-page="home"] #homePage .daily-dish-photo {
        width: 100%;
        object-fit: cover;
    }

    body[data-page="home"] #homePage .daily-dish-button {
        flex: 0 0 auto;
    }

    body[data-page="home"] #homePage .daily-dish-photo-wrap,
  body[data-page="home"] #homePage .daily-dish-photo {
        height: 100%;
        min-height: 0;
        width: 100%;
    }

    html,
  body {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    body[data-page="home"] > #appMain {
        flex: 1 1 0;
        height: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body[data-page="home"] > #appMain > .page-layout {
        flex: 1 1 0;
        height: 0;
        min-height: 0;
        padding: 14px 28px 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: stretch;
        gap: 28px;
        overflow: visible;
    }

    body[data-page="home"] #appMain .page-content {
        height: 100%;
        min-height: 0;
        overflow: visible;
    }

    body[data-page="home"] #appMain .sidebar {
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 16px;
        padding: 0;
        max-height: none;
        align-items: stretch;
        overflow: visible;
    }

    body[data-page="home"] #appMain .sidebar > .side-card {
        flex: 0 0 auto;
        margin: 0;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 20px;
        overflow: visible;
    }

    body[data-page="home"] #appMain .sidebar > .side-card:nth-child(1) {
        height: 258px;
        min-height: 258px;
    }

    body[data-page="home"] #appMain .sidebar > .quick-access-card {
        height: 258px;
        min-height: 258px;
    }

    body[data-page="recipes"] #appMain .page-layout > .sidebar {
        position: sticky;
        top: 98px;
        align-self: start;
        height: max-content;
        z-index: 5;
    }

    body[data-page="recipes"] #appMain .recipe-grid .recipe-image-wrap {
        height: clamp(150px, 19vh, 170px);
        min-height: 0;
        aspect-ratio: auto;
        overflow: hidden;
    }

    body[data-page="recipes"] #appMain .recipe-grid .recipe-image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    body[data-page="recipes"] #appMain .recipe-grid {
        row-gap: 46px;
        column-gap: 18px;
    }

    body[data-page="home"] #appMain .sidebar > .quick-access-card .quick-action {
        height: auto;
        min-height: 57px;
        flex: 0 0 auto;
    }
}

/* RESPONSIVE — TABLETTE ET MOBILE */

@media (max-width:1050px) {
    .side-card {
        margin: 0;
    }

    .page-layout {
        grid-template-columns: 1fr;
    }

    #appMain .page-layout {
        grid-template-columns: minmax(0,1fr);
        padding: 16px 24px 0;
    }

    body[data-page="home"] #homePage .hero {
        min-height: 220px;
    }

    .shell {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    #homePage .hero-card {
        height: auto;
        min-height: 250px;
    }

    #homePage .daily-dish {
        height: auto;
        min-height: 245px;
    }

    #homePage .daily-dish-photo-wrap {
        height: 245px;
    }

    .topbar {
        min-height: 92px;
        height: 92px;
        flex-basis: 92px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .brand-mark {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
    }

    body[data-page="home"] #homePage .hero,
  body[data-page="home"] #homePage .hero-card {
        min-height: 240px;
    }

    body[data-page="home"] #homePage .daily-dish {
        min-height: 260px;
    }

    body[data-page="home"] #homePage .daily-dish-copy,
  body[data-page="home"] #homePage .daily-dish-photo-wrap,
  body[data-page="home"] #homePage .daily-dish-photo {
        min-height: 260px;
    }

    .sidebar .side-card:first-child {
        height: auto;
        min-height: 174px;
    }

    .sidebar {
        gap: 14px;
        display: grid;
        grid-template-columns: repeat(2,1fr);
    }

    .sidebar > .side-card {
        height: auto;
        min-height: 0;
        margin: 0;
    }

    body[data-page="home"] {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body[data-page="home"] > #appMain {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    body[data-page="home"] > #appMain > .page-layout {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    body[data-page="home"] #homePage {
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    body[data-page="home"] #homePage .hero,
  body[data-page="home"] #homePage .daily-dish {
        height: auto;
        min-height: 0;
    }

    body[data-page="home"] #homePage .hero-card {
        height: auto;
        min-height: 220px;
    }

    body[data-page="home"] #homePage .daily-dish-copy {
        height: auto;
        min-height: 0;
    }

    body[data-page="recipes"] #appMain .sidebar > .recipe-sites-card,
body[data-page="home"] #appMain .sidebar {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    body[data-page="home"] #appMain .sidebar > .side-card {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width:760px) {
    .shell {
        padding: 0 18px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav {
        display: none;
        gap: 18px;
    }

    .menu-btn {
        display: inline-block;
    }

    .hero-card:after {
        background: linear-gradient(0deg,rgba(39,34,27,.83),rgba(39,34,27,.08));
    }

    .section-title {
        font-size: 26px;
    }

    .recipe-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 12px;
    }

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

    .detail-category-heading {
        align-items: flex-start;
    }

    .detail-category-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .detail-category-actions {
        flex-wrap: wrap;
    }

    .detail-body {
        padding: 20px 17px 28px;
    }

    .page-layout {
        padding-top: 16px;
        gap: 22px;
    }

    #appMain .page-layout {
        padding-top: 16px;
        gap: 22px;
        padding: 14px 18px 0;
    }

    #homePage .daily-dish-photo-wrap {
        order: -1;
        height: 190px;
        min-height: 190px;
    }

    #homePage .daily-dish-photo {
        height: 190px;
        min-height: 190px;
    }

    .topbar {
        min-height: 92px;
        height: auto;
        flex-basis: auto;
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 1100;
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
        max-width: none;
        left: 0;
        transform: none;
        background: rgba(120,134,108,.58);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background-color: rgba(120,134,108,.58);
        border: 0;
        border-bottom: 0;
        box-shadow: 0 3px 12px rgba(35,45,29,.12);
        padding-left: 18px;
        padding-right: 18px;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
        flex-basis: 52px;
        flex: 0 0 54px;
    }

    body[data-page="home"] #homePage .daily-dish {
        grid-template-columns: 1fr;
    }

    body[data-page="home"] #homePage .daily-dish-photo-wrap {
        order: -1;
        height: 190px;
        min-height: 190px;
    }

    body[data-page="home"] #homePage .daily-dish-photo {
        height: 190px;
        min-height: 190px;
    }

    body[data-page="home"] #homePage .daily-dish-copy {
        min-height: 0;
        padding: 20px 22px;
    }

    .sidebar .side-card:first-child {
        min-height: 148px;
        height: auto;
    }

    html, body {
        width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    body {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        background: linear-gradient(
      180deg,
      #66765b 0%,
      #78866c 22%,
      #aab39a 55%,
      #f5f0e7 100%
    );
        background-attachment: scroll;
    }

    .brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 9px;
    }

    .brand-name {
        font-size: clamp(18px, 5vw, 23px);
        line-height: 1.1;
        white-space: nowrap;
    }

    .brand-sub {
        font-size: 8px;
        letter-spacing: 1.8px;
    }

    .topbar-actions {
        display: flex;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .topbar .icon-btn {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .nav.mobile-open {
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
    }

    #appMain {
        width: 100%;
        max-width: none;
        min-height: calc(100vh - 100px);
        height: auto;
        display: block;
        overflow: visible;
        flex: none;
    }

    #appMain > .page-layout {
        width: 100%;
        max-width: none;
        min-height: 0;
        height: auto;
        padding: 16px 16px 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
        overflow: visible;
    }

    #appMain .page-content,
  #appMain .page-view,
  #homePage,
  #recipesPage {
        width: 100%;
        max-width: none;
        min-width: 0;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    #homePage {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    #homePage .hero {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0 0 22px;
        margin: 0;
    }

    #homePage .hero-card {
        width: 100%;
        height: auto;
        min-height: 0;
        display: flex;
        align-items: stretch;
        overflow: hidden;
        border-radius: 24px;
        flex-direction: column;
        justify-content: flex-start;
        background: linear-gradient(145deg, #526747, #78866c);
    }

    #homePage .hero-content {
        position: relative;
        width: 100%;
        max-width: none;
        padding: 26px 24px 30px;
        margin: 0;
        z-index: 1;
        background: linear-gradient(145deg, #526747, #78866c);
        color: #fffdf5;
    }

    #homePage .hero h1 {
        font-size: clamp(34px, 9vw, 42px);
        line-height: 1.12;
        margin: 14px 0;
        color: #fffdf5;
    }

    #homePage .hero p {
        max-width: 100%;
        font-size: 16px;
        line-height: 1.65;
        margin: 12px 0 22px;
        color: #f4f0e7;
    }

    #homePage .primary-btn {
        max-width: 100%;
        white-space: normal;
        padding: 13px 18px;
        font-size: 13px;
    }

    #homePage .daily-dish {
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
    }

    #homePage .daily-dish-photo-wrap,
  #homePage .daily-dish-photo {
        width: 100%;
        height: 190px;
        min-height: 190px;
    }

    #homePage .daily-dish-copy {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 20px 20px 22px;
        overflow: visible;
    }

    #homePage .daily-dish-title {
        font-size: 25px;
        line-height: 1.15;
    }

    #recipesPage .recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #recipesPage .search-wrap {
        width: 100%;
        min-width: 0;
    }

    #recipesPage .search-box {
        min-width: 0;
    }

    #appMain .sidebar {
        position: static;
        inset: auto;
        transform: none;
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 14px;
        overflow: visible;
    }

    #appMain .sidebar > .side-card {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        flex: 0 0 auto;
        margin: 0;
        padding: 20px;
        box-sizing: border-box;
    }

    #appMain .sidebar > .side-card:first-child {
        min-height: 132px;
    }

    body[data-page="recipes"] #recipesPage .search-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 8px;
    }

    body[data-page="recipes"] #recipesPage .search-box {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        padding: 0 12px;
        box-sizing: border-box;
    }

    body[data-page="recipes"] #recipesPage .search-box input {
        min-width: 0;
        width: 100%;
        font-size: 14px;
        text-overflow: ellipsis;
    }

    body[data-page="recipes"] #recipesPage .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0 13px;
    }

    body[data-page="home"] #homePage .hero-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        min-height: 0;
        height: auto;
        overflow: hidden;
        background: #58684e;
        border-radius: 24px;
        margin-top: 0;
    }

    body[data-page="home"] #homePage .hero-photo {
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        filter: none;
        background: #e7ddce;
    }

    body[data-page="home"] #homePage .hero-card::after {
        display: none;
        content: none;
    }

    body[data-page="home"] #homePage .hero-content {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: none;
        padding: 25px 23px 28px;
        background: linear-gradient(145deg, #58684e, #718064);
        color: #fffdf5;
    }

    body[data-page="home"] #homePage .hero .eyebrow {
        color: #e8ebdf;
    }

    body[data-page="home"] #homePage .hero h1 {
        color: #fffdf5;
        font-size: clamp(32px, 8vw, 40px);
        line-height: 1.12;
        margin: 10px 0 12px;
    }

    body[data-page="home"] #homePage .hero p {
        color: #f4f0e7;
        font-size: 15px;
        line-height: 1.65;
        margin: 0 0 19px;
    }

    body[data-page="home"] #homePage .hero .primary-btn {
        max-width: 100%;
        white-space: normal;
    }

    #homePage .hero-photo {
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center;
        filter: none;
    }

    #homePage .hero-card:after {
        display: none;
    }

    #homePage .hero .eyebrow {
        color: #e8ebdf;
        line-height: 1.6;
    }

    #homePage .hero .primary-btn {
        max-width: 100%;
        white-space: normal;
        padding: 15px 22px;
        font-size: 15px;
    }

    body[data-page="home"] #appMain,
  body[data-page="recipes"] #appMain {
        position: relative;
        z-index: 1;
    }

    .topbar::before,
  .topbar::after {
        border: 0;
        box-shadow: none;
    }

    #chips .recipe-count-chip {
        min-height: 36px;
        padding: 0 12px;
    }
}

@media screen and (max-width:760px) {
    body[data-page="recipes"] #appMain #recipesPage .sidebar > .quick-access-card {
        height: 258px;
        min-height: 258px;
    }

    body[data-page="recipes"] #appMain .sidebar > .quick-access-card {
        height: 258px;
        min-height: 258px;
    }

    body[data-page="home"] #appMain .page-layout,
  body[data-page="recipes"] #appMain .page-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        align-items: stretch;
        justify-content: flex-start;
        gap: 22px;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    body[data-page="home"] #appMain .page-content,
  body[data-page="recipes"] #appMain .page-content {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    body[data-page="home"] #appMain #homePage {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        grid-template-rows: none;
        align-items: stretch;
        justify-content: flex-start;
        gap: 18px;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    body[data-page="home"] #appMain #homePage .hero,
  body[data-page="home"] #appMain #homePage .hero-card,
  body[data-page="home"] #appMain #homePage .daily-dish {
        position: relative;
        inset: auto;
        transform: none;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        flex: none;
        margin: 0;
        overflow: hidden;
    }

    body[data-page="home"] #appMain #homePage .hero-card {
        min-height: 420px;
        display: flex;
        align-items: flex-end;
    }

    body[data-page="home"] #appMain #homePage .hero-content {
        position: relative;
        inset: auto;
        transform: none;
        width: 100%;
        max-width: none;
        height: auto;
        padding: 28px 22px;
        box-sizing: border-box;
    }

    body[data-page="home"] #appMain #homePage .hero h1 {
        display: block;
        font-size: 34px;
        line-height: 1.08;
        margin: 10px 0 12px;
    }

    body[data-page="home"] #appMain #homePage .hero p {
        display: block;
        font-size: 15px;
        line-height: 1.45;
        margin: 0 0 16px;
    }

    body[data-page="home"] #appMain #homePage .daily-dish {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    body[data-page="home"] #appMain #homePage .daily-dish-copy {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 22px;
        box-sizing: border-box;
    }

    body[data-page="home"] #appMain #homePage .daily-dish-photo-wrap {
        position: relative;
        width: 100%;
        height: 190px;
        min-height: 190px;
    }

    body[data-page="home"] #appMain .sidebar,
  body[data-page="recipes"] #appMain .sidebar {
        position: relative;
        inset: auto;
        float: none;
        transform: none;
        display: flex;
        flex-direction: column;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 0;
        gap: 14px;
        overflow: visible;
    }

    body[data-page="home"] #appMain .sidebar > .side-card,
  body[data-page="recipes"] #appMain .sidebar > .side-card {
        position: relative;
        inset: auto;
        transform: none;
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        flex: none;
        margin: 0;
        padding: 20px;
        box-sizing: border-box;
        overflow: visible;
    }

    body[data-page="home"] #appMain,
  body[data-page="recipes"] #appMain {
        margin-top: 0;
        min-height: 0;
        height: auto;
        padding: 0 24px;
    }

    body[data-page="home"] #appMain > .page-layout,
  body[data-page="recipes"] #appMain > .page-layout {
        padding-top: 8px;
    }

    body[data-page="home"] #homePage .hero {
        position: static;
        top: auto;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 22px;
    }

    body[data-page="recipes"] #appMain #recipesPage .recipe-grid {
        grid-template-columns: minmax(0, 1fr);
        column-gap: 0;
        row-gap: 18px;
    }
}

@media (max-width:650px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "brand"
      "actions"
      "nav";
        align-items: center;
        column-gap: 12px;
        row-gap: 12px;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 16px;
        min-height: 0;
        overflow: visible;
    }

    .topbar > .brand {
        grid-area: brand;
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        width: 100%;
        justify-self: start;
    }

    .topbar .brand-mark {
        width: 58px;
        height: 58px;
        flex: 0 0 58px;
        object-fit: contain;
        min-width: 58px;
    }

    .topbar .brand-name {
        font-size: clamp(18px, 5vw, 23px);
        white-space: nowrap;
    }

    .topbar .brand-sub {
        font-size: 9px;
        letter-spacing: .12em;
    }

    .topbar > .nav {
        grid-area: nav;
        display: none;
        position: static;
        width: 100%;
        box-sizing: border-box;
        flex-wrap: wrap;
        justify-content: center;
        gap: 22px;
        margin: 0;
        padding: 12px 0 5px;
    }

    .topbar > .nav.mobile-open {
        display: flex;
        background: rgba(82,103,71,.68);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,.22);
        border-radius: 12px;
        padding: 15px 12px;
        margin-top: 2px;
        box-shadow: 0 5px 14px rgba(35,45,29,.16);
        justify-content: center;
        gap: clamp(18px, 7vw, 32px);
    }

    .topbar-actions {
        grid-area: actions;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
        width: 100%;
        margin: 0;
        flex-wrap: wrap;
    }

    .topbar-actions .welcome-message {
        flex: 1 0 100%;
        text-align: right;
        white-space: normal;
    }

    .topbar-actions .icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        margin: 0;
        position: static;
        transform: none;
        flex-shrink: 0;
    }

    .topbar-actions .auth-logout-button {
        min-height: 44px;
        padding: 0 12px;
        margin: 0;
        font-size: 13px;
        flex-shrink: 0;
    }

    .topbar > .nav.mobile-open a,
  .topbar > .nav.mobile-open a:visited {
        color: #fffdf5;
        font-weight: 700;
        font-size: 15px;
        text-decoration: none;
        opacity: 1;
        text-shadow: none;
    }

    .topbar > .nav.mobile-open a[aria-current="page"] {
        color: #ffffff;
        text-decoration: underline;
        text-decoration-color: #e8d7a9;
        text-decoration-thickness: 2px;
        text-underline-offset: 7px;
    }

    .manual-import-columns {
        grid-template-columns: 1fr;
    }

    .manual-import-panel {
        max-height: 95vh;
    }
}

@media screen and (max-width:650px) {
    body[data-page="recipes"] #appMain #recipesPage .recipe-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        column-gap: 0;
        row-gap: 18px;
        width: 100%;
    }

    body[data-page="recipes"] #appMain #recipesPage .recipe-grid > * {
        min-width: 0;
        width: 100%;
    }

    body[data-page="recipes"] #appMain .sidebar > .quick-access-card {
        height: 258px;
        min-height: 258px;
    }
}

@media (max-width:480px) {
    .recipe-info {
        padding: 12px;
    }

    .recipe-info h3 {
        font-size: 15px;
    }

    .meta {
        flex-wrap: wrap;
    }

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

    .hero h1 {
        font-size: 34px;
    }

    .detail-overlay {
        padding: 8px;
    }

    .detail-panel {
        border-radius: 18px;
    }

    .detail-image {
        aspect-ratio: 4/3;
    }

    .daily-dish-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .daily-dish-actions button {
        width: 100%;
    }
}

@media (max-width:420px) {
    .recipe-confirm-panel {
        padding: 20px 17px 17px;
    }

    .recipe-confirm-actions button {
        min-width: 0;
        flex: 1;
    }
}

@media (max-width:400px) {
    .recipe-sites-card .recipe-sites-links-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width:380px) {
    .topbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .brand-name {
        font-size: 18px;
    }

    .topbar .icon-btn {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    #homePage .hero-card {
        min-height: 370px;
    }

    #recipesPage .recipe-grid {
        grid-template-columns: 1fr;
    }
}

/* ACCESSIBILITÉ — MOUVEMENT RÉDUIT */

@media (prefers-reduced-motion:reduce) {
    .recipe-confirm-overlay,
  .recipe-confirm-panel {
        animation: none;
    }
}

/* IMPRESSION */

@media print {
    .detail-desc {
        display: none !important;
    }

    html,
  body {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        background-image: none !important;
        color: #222 !important;
        font-size: 12pt !important;
        overflow: visible !important;
    }

    body > header.topbar,
  body > #appMain,
  body > #recipeDeleteConfirm {
        display: none !important;
    }

    body > #detailOverlay {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    #detailOverlay .detail-panel {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    #detailOverlay .detail-top,
  #detailOverlay .detail-actions,
  #detailOverlay .portion-control button {
        display: none !important;
    }

    #detailOverlay .portion-control {
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
        font-size: 12pt !important;
        color: #222 !important;
    }

    #detailOverlay .portion-control span {
        font-size: 12pt !important;
        font-weight: 400 !important;
        letter-spacing: normal !important;
        text-transform: none !important;
        color: #222 !important;
    }

    #detailOverlay .portion-control strong {
        display: inline !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #222 !important;
        font-family: inherit !important;
        font-size: 14pt !important;
        font-weight: 700 !important;
        line-height: inherit !important;
    }

    #detailOverlay .detail-body {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        color: #222 !important;
        font-size: 12pt !important;
        line-height: 1.35 !important;
    }

    #detailOverlay .detail-title {
        margin: 0 0 14px !important;
        font-size: 25pt !important;
        line-height: 1.15 !important;
        text-align: center !important;
    }

    #detailOverlay .detail-desc {
        margin: 0 0 8px !important;
        font-size: 11pt !important;
        line-height: 1.35 !important;
    }

    #detailOverlay .detail-image {
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        max-height: 27mm !important;
        margin: 0 auto 12px !important;
        object-fit: contain !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    #detailOverlay .detail-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        justify-content: center !important;
        margin: 0 0 12px !important;
    }

    #detailOverlay .detail-meta > * {
        margin: 0 !important;
        padding: 4px 7px !important;
        font-size: 10pt !important;
    }

    #detailOverlay .detail-section {
        margin: 13px 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #detailOverlay .detail-section h3 {
        margin: 10px 0 9px !important;
        font-size: 19pt !important;
        line-height: 1.2 !important;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    #detailOverlay .ingredient-list {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #detailOverlay .ingredient-group {
        display: block !important;
        margin: 0 0 15px !important;
        padding: 0 !important;
    }

    #detailOverlay .ingredient-group-heading {
        display: block !important;
        margin: 13px 0 9px !important;
        padding: 7px 10px !important;
        border-left: 5px solid #80664b !important;
        border-bottom: 1px solid #d8cbbd !important;
        background: #f6f1e9 !important;
        color: #654b35 !important;
        font-size: 15pt !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    #detailOverlay .ingredient-group-items {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: start !important;
        column-gap: 12px !important;
        row-gap: 7px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #detailOverlay .ingredient-group:not(:first-child) {
        margin-top: 16px !important;
        padding: 9px 10px 11px !important;
        border: 1px solid #d8cbbd !important;
        border-radius: 6px !important;
        background: #faf7f1 !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    #detailOverlay .ingredient-row {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
        border: 1px solid #ddd !important;
        border-radius: 5px !important;
        background: #fff !important;
        color: #222 !important;
        font-size: 12.5pt !important;
        line-height: 1.35 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    #detailOverlay .step-list {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #detailOverlay .step-row {
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 12px !important;
        padding: 7px 0 10px !important;
        box-sizing: border-box !important;
        border: 0 !important;
        border-bottom: 1px solid #ddd !important;
        border-radius: 0 !important;
        background: #fff !important;
        color: #222 !important;
        font-size: 13pt !important;
        line-height: 1.4 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    #detailOverlay .step-number {
        flex: 0 0 32px !important;
        min-width: 32px !important;
        font-size: 14pt !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
    }

    #detailOverlay .step-row strong {
        display: block !important;
        margin: 0 0 4px !important;
        font-size: 14pt !important;
        line-height: 1.3 !important;
        color: #222 !important;
    }

    #detailOverlay .step-row p {
        margin: 3px 0 !important;
        font-size: 13pt !important;
        line-height: 1.4 !important;
        color: #222 !important;
        orphans: 2;
        widows: 2;
    }

    #detailOverlay .step-row span {
        min-width: 0 !important;
    }

    #detailOverlay a {
        color: #222 !important;
    }
}
