/* Shared phone layout: preserve artwork and readable content, reclaim chrome space. */
@media (max-width: 600px) {
  .app { margin-top:0; margin-bottom:0; border-radius:0; }
  .app > header, .app > header#brand {
    height:96px; min-height:96px; padding:0 8px; margin:0;
    gap:6px; flex-shrink:0;
  }
  .app > header .logo {
    width:88px; height:88px; min-width:0; flex:0 1 88px;
    object-fit:contain;
  }
  .app > header .hello { min-width:0; gap:4px; }
  .app > header .hello img { width:28px; height:28px; }
  .app > header .hello b { font-size:14px; overflow-wrap:anywhere; }
  .app > header .hello span { font-size:12px; }
  .app > header .status { flex-shrink:0; font-size:12px; }
  .app > header .status > div { display:grid; grid-template-columns:repeat(2,44px); gap:0; }
  .app > header .status button { width:44px; min-height:36px; padding:6px; }
  .app > header .status button svg { width:22px; height:22px; }
  .app > header .status > span { margin-top:0; }
  .app > .trial { margin:3px 8px 0; font-size:12px; line-height:1.3; }
  .app > .quick-access { padding:2px 9px; gap:2px 8px; }
  .app > .quick-access select { min-height:44px; padding:4px 8px; }
  /* The original ribbon is now the navigation background, taking no extra row. */
  .app > footer:has(> nav) { position:relative; flex-shrink:0; }
  .app > footer:has(> nav) > .ribbon { display:none; }
  .app > footer > nav {
    position:relative; isolation:isolate;
    background-image:linear-gradient(#0005,#000b),url('/salon/assets/ruban.png');
    background-size:100% 100%; background-position:center; background-repeat:no-repeat;
    display:flex; align-items:stretch; gap:0;
    margin:0; padding:5px 2px 4px; min-height:68px;
  }
  .app > footer > nav > a, .app > footer > nav > button {
    flex:1 1 0; min-width:0; min-height:56px; padding:3px 1px;
    font-size:24px; line-height:1.1; background:transparent;
    text-shadow:0 1px 3px #000,0 0 5px #000;
  }
  .app > footer > nav span {
    display:block; font-size:11px; line-height:1.25; margin-top:5px;
    overflow-wrap:anywhere; word-break:normal;
  }
  .app > footer > nav .selected { color:#ff6685; }
  .app > .content { scroll-padding-bottom:16px; }
  /* Real account pages have no bottom menu: keep their ribbon shallow. */
  .real-accounts .app > header {
    display:grid; grid-template-columns:minmax(0,1fr) 88px;
    height:auto; min-height:0; gap:0 8px; padding:2px 12px;
  }
  .real-accounts header > img { width:88px; height:88px; object-fit:contain; }
  .real-accounts header small { margin-top:4px; }
  .real-accounts .language { grid-column:1/-1; margin:0; gap:8px; }
  .real-accounts .language select { min-height:44px; padding:4px 8px; }
  .real-accounts footer img { height:52px; object-fit:fill; }
  .real-accounts #auth, .real-accounts #account { padding:12px; }
  .real-accounts .tabs { gap:6px; margin-bottom:12px; }
  .real-accounts .tabs button { min-height:44px; }
  .real-accounts .demo { margin-top:12px; padding:10px 12px; }
  .flirtme .entry-language { padding-top:4px; gap:6px; }
  .flirtme .welcome { padding:8px 20px; }
  .flirtme .logo { max-width:210px; margin:8px auto 12px; }
  .flirtme > footer.ribbon { max-height:64px; overflow:hidden; }
  .flirtme > footer.ribbon img { height:64px; object-fit:fill; }
}



/* Phone language control: first row, compact, left aligned. */
@media (max-width:600px) {
  .app > .quick-access {
    justify-content:flex-start; align-items:center; width:100%;
    padding:0 8px; gap:0 6px; min-height:36px;
  }
  .app > .quick-access .quick-language-label { font-size:12px; gap:5px; }
  .app > .quick-access select {
    font-size:12px; min-height:36px; height:36px;
    width:124px; max-width:45vw; padding:3px 7px;
  }
  .flirtme .entry-language { justify-content:flex-start; padding:0 8px; gap:5px; }
  .flirtme .entry-language label { font-size:12px; }
  .flirtme .entry-language select { font-size:12px; min-height:36px; padding:3px 7px; }
  .real-accounts .app > header > .language {
    grid-row:1; grid-column:1/-1; justify-self:start; justify-content:flex-start;
    width:auto; gap:5px; font-size:12px;
  }
  .real-accounts .language > span { font-size:0; }
  .real-accounts .language > span::before { content:'🌐'; font-size:14px; }
  .real-accounts .language select {
    margin-left:0; font-size:12px; width:124px; max-width:45vw;
    min-height:36px; height:36px; padding:3px 7px;
  }
  .real-accounts .app > header > div { grid-row:2; grid-column:1; }
  .real-accounts .app > header > a { grid-row:2; grid-column:2; }
  .real-accounts .app > header > a img { width:88px; height:88px; object-fit:contain; }
}

/* Ribbon behind navigation on phones, tablets and larger screens. */
  /* The original ribbon is now the navigation background, taking no extra row. */
  .app > footer:has(> nav) { position:relative; flex-shrink:0; }
  .app > footer:has(> nav) > .ribbon { display:none; }
  .app > footer > nav {
    position:relative; isolation:isolate;
    background-image:linear-gradient(#0005,#000b),url('/salon/assets/ruban.png');
    background-size:100% 100%; background-position:center; background-repeat:no-repeat;
    display:flex; align-items:stretch; gap:0;
    margin:0; padding:5px 2px 4px; min-height:68px;
  }
  .app > footer > nav > a, .app > footer > nav > button {
    flex:1 1 0; min-width:0; min-height:56px; padding:3px 1px;
    font-size:24px; line-height:1.1; background:transparent;
    text-shadow:0 1px 3px #000,0 0 5px #000;
  }
  .app > footer > nav span {
    display:block; font-size:11px; line-height:1.25; margin-top:5px;
    overflow-wrap:anywhere; word-break:normal;
  }
  .app > footer > nav .selected { color:#ff6685; }

.flirtme > footer.ribbon > img { display:none; }
.flirtme > footer.ribbon { background:linear-gradient(#0005,#000b),url("/salon/assets/ruban.png") center/100% 100% no-repeat; min-height:68px; max-height:none; }
.flirtme > footer.ribbon nav { position:relative; min-height:68px; display:flex; align-items:center; justify-content:center; }

/* Lift ribbon and navigation together, keeping the hearts above the lower edge. */
.flirtme > footer.ribbon,
.app > footer:has(> nav) { margin-bottom:40px; }

/* Keep the raised artwork fixed while returning menu controls to the lower row. */
.app > footer:has(> nav)::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(#0005,#000b),url('/salon/assets/ruban.png') center/100% 100% no-repeat;
}
.app > footer > nav { background-image:none; transform:translateY(40px); }

/* Lower only the decorative ribbon by 15px; keep navigation controls fixed. */
.app > footer:has(> nav)::before { transform:translateY(15px); }
.flirtme > footer.ribbon { position:relative; background:none; }
.flirtme > footer.ribbon::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(#0005,#000b),url('/salon/assets/ruban.png') center/100% 100% no-repeat;
  transform:translateY(15px);
}

/* Salon composer remains above the same navigation and ribbon as other pages. */
.app > .composer { flex-shrink:0; margin:4px 0 8px; }
.app > footer.footer:has(> nav) { padding:0; border-radius:0; }
.app > footer.footer > nav > button { display:block; }

/* Phone adjustment: frame 10px shorter, original ribbon 10px lower on screen. */
@media(max-width:600px){
 body:not(.real-accounts) .app{height:calc(100dvh - 10px);margin-top:0;margin-bottom:10px}
 .real-accounts .app{min-height:calc(100dvh - 10px);margin-bottom:10px}
 .flirtme{min-height:calc(100dvh - 10px);margin-bottom:10px}
 .app>footer:has(>nav)::before,.flirtme>footer.ribbon::before{transform:translateY(35px)}
 .app.salon-app{overflow:visible}
 .app.salon-app>footer.footer::before{transform:none;translate:0 8px}
 .real-accounts .app{overflow:visible}
 .real-accounts .app>footer img{transform:translateY(20px)}
}

/* Reclaim 40px from the phone footer's empty frame, keeping artwork and menu
   at exactly the same screen position. Salon already uses its compact footer. */
@media(max-width:600px){
 .app:not(.salon-app)>footer:has(>nav),.flirtme>footer.ribbon{margin-bottom:0}
 .app:not(.salon-app)>footer:has(>nav)::before,.flirtme>footer.ribbon::before{transform:translateY(-5px)}
 .app:not(.salon-app)>footer>nav{transform:none}
 .real-accounts .app>footer{height:12px;flex-shrink:0}
 .real-accounts .app>footer img{transform:translateY(-20px)}
}
