/* Sadarin adaptive glass surfaces */
#header {
  background: linear-gradient(180deg, rgba(9, 38, 43, .28), rgba(9, 38, 43, .06));
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

#header.scrolled,
#header.menu-open {
  background: rgba(252, 252, 249, .84);
  border-bottom-color: rgba(25, 60, 75, .1);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(24, 60, 75, .08);
}

#header .brand img { transition: opacity .3s ease, transform .3s ease; }
#header .logo-white { filter: drop-shadow(0 2px 8px rgba(0, 24, 30, .18)); }
#header.scrolled .brand img,
#header.menu-open .brand img { transform: scale(.92); }
#header.menu-open .logo-white { opacity: 0; }
#header.menu-open .logo-color { opacity: 1; }

.mobile-account { display: none; }

@media (max-width: 680px) {
  #header {
    top: 41px;
    left: 14px;
    right: 14px;
    width: auto;
    height: 68px;
    padding: 0 14px;
    border-radius: 24px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(8, 35, 40, .38), rgba(8, 35, 40, .12));
    border-bottom-color: rgba(255, 255, 255, .16);
    box-shadow: 0 12px 30px rgba(10, 35, 41, .12);
  }

  #header.scrolled {
    height: 68px;
    top: calc(10px + env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    width: auto;
    padding: 0 14px;
    border-radius: 24px;
    box-sizing: border-box;
  }

  #header .brand { width: 112px; }
  #header .brand img { height: 58px; }
  #header .menu-toggle {
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 24px;
    background: rgba(12, 43, 49, .16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  #header.scrolled .menu-toggle,
  #header.menu-open .menu-toggle {
    background: rgba(255, 255, 255, .62);
    border-color: rgba(25, 60, 75, .13);
  }

  #header nav {
    top: calc(100% + 8px);
    background: rgba(252, 252, 249, .9);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(25, 60, 75, .1);
    border-radius: 22px;
  }

  .hero { padding-top: 105px; }
}

.plan { position: relative; }
.plan.recommended {
  border-color: rgba(33, 139, 151, .7);
  background: linear-gradient(145deg, #fff, #f1f8f7);
  box-shadow: 0 15px 34px rgba(19, 94, 106, .1);
}
.recommendation {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #167f8a;
  color: #fff;
  font-size: 10px !important;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.plan.recommended .plan-link { color: #126f79; font-weight: 700; }

@media (max-width: 680px) {
  .faq { padding-bottom: 36px; }
  footer { padding: 38px 24px 28px; text-align: center; }
  .footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 28px;
  }
  .footer-top .brand { width: 128px; margin: 0; }
  .footer-top .brand img { height: auto; }
  .footer-top p { line-height: 1.8; }
  .footer-top .text-link {
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid rgba(8, 125, 137, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .68);
  }
  .footer-bottom {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
    padding-top: 26px;
  }
  .footer-bottom nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 340px;
    margin: 0;
    gap: 15px 18px;
    text-align: center;
  }
  .footer-email {
    display: inline-flex;
    justify-content: center;
    color: var(--teal);
    font-weight: 600;
  }
  .recommendation { top: 20px; right: 20px; }
}

@media (max-width: 560px) {
  .sidebar {
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    height: 72px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 28px;
    background: rgba(250, 250, 253, .78);
    box-shadow: 0 14px 38px rgba(30, 34, 59, .2), inset 0 1px 0 rgba(255, 255, 255, .8);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
  }

  .sidebar nav { gap: 3px; }
  .sidebar nav button {
    min-width: 0;
    min-height: 58px;
    border-radius: 22px;
    color: #626a7e;
  }

  .sidebar nav button.active {
    background: rgba(103, 80, 178, .14);
    color: #5e45a8;
  }

  .sidebar nav button[data-view="history"] { display: none; }
  .mobile-account { display: flex !important; }
  .sidebar nav button svg { width: 21px; height: 21px; }
  .app > header {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    width: auto;
    height: 68px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    box-sizing: border-box;
    z-index: 35;
    border-bottom-color: rgba(68, 71, 99, .08);
    box-shadow: 0 12px 32px rgba(32, 41, 57, .14), inset 0 1px 0 rgba(255, 255, 255, .85);
  }

  .app > header .header-actions { gap: 7px; }
  .app > header .mobile-brand { width: 86px; height: 44px; }
  .app > header .mobile-brand img { width: 84px; max-height: 42px; }
  .app > header .ambient-toggle,
  .app > header .scenes-open,
  .app > header .avatar { flex-shrink: 0; }

  main {
    padding-top: calc(104px + env(safe-area-inset-top));
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .app footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 10px 24px;
    text-align: center;
  }
  .app footer .footerbrand { margin-bottom: 2px; }
  .app footer button { width: auto; margin: 0; text-align: center; }
  .player {
    bottom: calc(96px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    min-height: 82px;
    padding: 9px 12px 7px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 42px 28px;
    grid-template-rows: 58px 4px;
    align-items: center;
    gap: 0 10px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    background: rgba(250, 250, 253, .88);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    box-shadow: 0 14px 38px rgba(32, 31, 57, .2), inset 0 1px 0 rgba(255, 255, 255, .85);
  }

  .player .mini-art {
    grid-column: 1;
    grid-row: 1;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background-position: center;
    background-size: cover;
  }

  .player .track-info {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
  }

  .player .track-info b {
    font-size: 13px;
    line-height: 1.45;
  }

  .player .track-info small {
    font-size: 10px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player .transport { display: contents; }
  .player .transport-buttons {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    place-items: center;
  }

  .player .transport-buttons > button:not(#play) { display: none; }
  .player .transport-buttons .play-main {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #198b9a, #6750b2);
    box-shadow: 0 7px 18px rgba(82, 70, 161, .25);
  }

  .player .transport-buttons .play-main svg { width: 18px; height: 18px; }
  .player .seekline {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    display: block;
  }

  .player .seekline time { display: none; }
  .player .seekline input {
    display: block;
    width: 100%;
    height: 4px;
    margin: 0;
    accent-color: #238c9a;
  }

  .player .player-extras {
    grid-column: 4;
    grid-row: 1;
    margin: 0;
    display: grid;
    place-items: center;
  }

  .player .player-extras > button { display: none; }
  .player .player-extras #closePlayer {
    display: grid;
    place-items: center;
    width: 28px;
    height: 40px;
    font-size: 22px;
    color: #697086;
  }

  .player #audioStatus {
    left: 70px;
    bottom: 9px;
    max-width: calc(100% - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
  }

  body.has-player main { padding-bottom: calc(215px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(205px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  #header .brand img { transition: none; }
}
