/* PC outer shell only. The 410px LP keeps its existing design and content. */

/* Tablet and compact desktop: suppress the legacy 768px outer world. */
@media (min-width: 768px) and (max-width: 1199px) {
  body { background: var(--sub); overflow-x: hidden; }
  .desktop-bg { display: none !important; }
  .page {
    width: min(100%, var(--ufan-center-width)) !important;
    max-width: var(--ufan-center-width) !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .floating-header {
    top: 0 !important;
    left: 50% !important;
    right: auto !important;
    width: min(100%, var(--ufan-center-width)) !important;
    transform: translateX(-50%);
  }
  .menu-panel {
    left: 50% !important;
    right: auto !important;
    width: min(100%, var(--ufan-center-width)) !important;
    transform: translate(50%, 0);
  }
  .menu-panel.open { transform: translate(-50%, 0); }
}

@media (min-width: 1200px) {
  html, body, #root { width: 100%; height: 100%; }
  #root { display: flow-root; }
  html { overflow: hidden; }
  body { overflow: hidden; background: #fffdfc; }

  .desktop-bg {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
    animation: none;
  }
  .desktop-bg::before,
  .desktop-bg::after,
  .desktop-aura,
  .desktop-story { display: none !important; }

  .page {
    position: relative;
    z-index: 2;
    width: var(--ufan-center-width) !important;
    max-width: var(--ufan-center-width) !important;
    height: calc(100dvh - 24px);
    margin: 24px auto 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(187,110,141,.32) transparent;
    border: 1px solid rgba(218,204,211,.62) !important;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 14px 44px rgba(74,55,67,.11) !important;
    scroll-behavior: smooth;
  }
  .page > section,
  .page [id] { scroll-margin-top: 62px; }
  .page::-webkit-scrollbar { width: 5px; }
  .page::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(187,110,141,.28); }

  .floating-header {
    position: sticky !important;
    z-index: 50;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin-bottom: calc(var(--ufan-header-height) * -1);
    transform: none !important;
  }
  .floating-header .logo {
    display: inline-flex !important;
    margin-left: 18px;
  }
  .floating-header > button { display: none !important; }
  .menu-panel {
    position: fixed;
    top: 24px !important;
    bottom: 24px !important;
    left: 50% !important;
    right: auto !important;
    width: var(--ufan-center-width) !important;
    border-radius: 12px;
    transform: translateX(50%);
  }
  .menu-panel.open { transform: translateX(-50%); }

  .rail,
  .desktop-consult {
    position: fixed;
    z-index: 3;
    top: 24px;
    bottom: 24px;
    pointer-events: auto;
  }
  .rail {
    left: clamp(34px, 5vw, 88px);
    width: clamp(210px, calc(50vw - 285px), 320px);
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .rail .logo { width: max-content; }
  .rail .logo-word { font-size: 32px; }
  .rail .logo-symbol { width: 40px; height: 40px; }
  .rail nav { display: grid; gap: 4px; margin-top: clamp(38px, 6vh, 68px); }
  .rail nav a {
    display: flex;
    align-items: center;
    min-height: 39px;
    color: #9d969a;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: color .25s ease;
  }
  .rail nav a b { font-weight: 600; }
  .rail nav a.active { color: #b46384; font-weight: 700; }
  .rail nav a.active b { font-weight: 700; }
  .rail-foot { margin-top: auto; margin-bottom: 2px; }
  .rail-foot small { color: #999095; font-size: 9px; letter-spacing: .05em; }

  .desktop-consult {
    right: clamp(34px, 5vw, 88px);
    width: clamp(230px, calc(50vw - 260px), 310px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: #302b2e;
  }
  .consult-qr {
    width: clamp(174px, 15vw, 196px);
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    gap: 7px;
    text-align: center;
    color: #8f858a;
    background: rgba(255,255,255,.76);
    border: 1px dashed rgba(171,139,153,.7);
    box-shadow: 0 14px 34px rgba(74,55,67,.06);
  }
  .consult-qr span { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
  .consult-qr small { font-size: 10px; }
  .consult-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 260px);
    min-height: 58px;
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(90deg,#ca7898,#b984c5);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(164,99,130,.18);
  }
  .consult-line svg { width: 17px; }

  @keyframes desktop-gradient-drift {
    from { background-position: 100% 50%; }
    to { background-position: 0% 50%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-bg { animation: none !important; }
  .page { scroll-behavior: auto; }
}
