.pwa-launch-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  background: linear-gradient(160deg, #f8f6ff 0%, #eeeaff 52%, #f7f8ff 100%);
  color: #23164e;
  font-family: Arial, sans-serif;
}

html.pwa-launching .pwa-launch-screen {
  display: flex !important;
}

html.pwa-launching,
html.pwa-launching body {
  background: #f3efff !important;
  overflow: hidden !important;
}

html.pwa-launching body > :not(.pwa-launch-screen) {
  visibility: hidden !important;
}

.pwa-launch-screen img {
  width: 112px;
  height: 112px;
  margin-bottom: 12px;
  border-radius: 28px;
  box-shadow: 0 18px 46px rgba(73, 38, 172, .25);
}

.pwa-launch-screen strong {
  font-size: 30px;
  letter-spacing: .04em;
}

.pwa-launch-screen span {
  color: #776c95;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

.pwa-app-header,
.pwa-bottom-nav {
  display: none;
}

@media (display-mode: standalone) and (max-width: 820px) {
  html, body {
    min-height: 100%;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  body.user-page {
    padding-top: calc(140px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
  }

  body.user-page .pwa-app-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100001;
    height: calc(72px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    background: linear-gradient(100deg, #353dcc 0%, #6870f8 100%);
    color: #fff;
  }

  .pwa-app-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    text-align: center;
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    text-decoration: none;
    flex: 0 0 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
  }

  .pwa-app-title {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    line-height: 1.15;
    overflow: hidden;
  }

  .pwa-app-title b,
  .pwa-app-title small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    word-break: keep-all;
    text-overflow: ellipsis;
  }
  .pwa-app-title b { font-size: 20px; line-height: 1.1; }
  .pwa-app-title small { margin-top: 5px; font-size: 11px; line-height: 1.15; font-weight: 700; opacity: .9; }

  .pwa-refresh {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 9px;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: rgba(255,255,255,.15);
    color: #fff;
    flex: 0 0 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }

  .pwa-refresh svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.user-page .mobile-user-header {
    top: calc(72px + env(safe-area-inset-top)) !important;
    min-height: 68px !important;
    height: 68px !important;
    padding-top: 10px !important;
  }

  body.user-page .mobile-user-menu {
    top: calc(140px + env(safe-area-inset-top)) !important;
    max-height: calc(100dvh - 140px - 94px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    padding-bottom: 14px !important;
    overflow-y: auto !important;
  }

  body.user-page .pwa-bottom-nav {
    display: grid;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 100000;
    height: 72px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    padding: 7px;
    box-sizing: border-box;
    border: 1px solid rgba(211,216,231,.9);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 36px rgba(27,38,77,.18);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  /* iPhone 홈 화면 앱에서는 두 개의 상단 바 아래에 닫기 버튼을 고정한다. */
  body.user-page .iphone-guide-modal {
    padding-top: calc(154px + env(safe-area-inset-top)) !important;
  }

  body.user-page .iphone-guide-dialog {
    max-height: calc(100dvh - 248px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }

  .pwa-bottom-nav a {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: 18px;
    color: #8c93a8;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    word-break: keep-all;
  }

  .pwa-bottom-nav a.active {
    background: linear-gradient(145deg, #eef0ff, #f6f6ff);
    color: #5b63f6;
  }

  .pwa-bottom-nav svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .pwa-bottom-nav a[data-pwa-tab="home"] svg,
  .pwa-bottom-nav a[data-pwa-tab="products"] svg,
  .pwa-bottom-nav a[data-pwa-tab="profile"] svg {
    fill: currentColor;
    stroke: none;
  }

  body.user-page main.main,
  body.user-page .site-footer {
    padding-bottom: 20px !important;
  }

  body.public-page {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .pwa-original-order-table { display: none !important; }
  .weef-order-cards {
    display: grid;
    gap: 12px;
    margin: 0 -10px;
    padding: 12px 10px 24px;
    background: #f6f7fc;
  }
  .weef-order-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid #e9ebf5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(36,43,83,.06);
  }
  .weef-order-field {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid #f0f1f7;
    border-bottom: 1px solid #f0f1f7;
  }
  .weef-order-field:nth-child(even) { border-right: 0; }
  .weef-order-field span {
    display: block;
    margin-bottom: 5px;
    color: #9298aa;
    font-size: 10px;
    font-weight: 800;
  }
  .weef-order-field strong {
    display: block;
    overflow-wrap: anywhere;
    color: #24283c;
    font-size: 12px;
    line-height: 1.4;
  }

  .my-info-page { padding: 10px 14px 30px !important; }
  .my-info-heading { margin-bottom: 18px !important; }
  .my-info-heading .eyebrow,
  .member-grade { display: none !important; }
  .my-info-heading h1 { margin: 0 0 6px !important; font-size: 25px !important; }
  .my-info-heading p { color: #777e92 !important; font-size: 13px; }
  .my-info-order-link {
    display: flex !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }
  .my-info-grid { display: flex !important; flex-direction: column; gap: 14px !important; }
  .my-info-side { display: contents !important; }
  .point-card { order: 1; background: linear-gradient(135deg,#5962f2,#767df8) !important; color: #fff; }
  .member-card { order: 2; }
  .password-card { order: 3; }
  .withdraw-card { display: block !important; order: 4; margin-top: 0 !important; }

  /* iPhone PWA final one-line layout adjustments */
  body.user-page .hero h1,
  body.user-page .hero h1 strong {
    white-space: nowrap !important;
    word-break: keep-all !important;
  }

  body.user-page .hero h1 {
    font-size: clamp(18px, 5vw, 21px) !important;
    line-height: 1.35 !important;
    letter-spacing: -.045em !important;
  }

  body.user-page .hero > div > p {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(7.8px, 2.15vw, 9px) !important;
    letter-spacing: -.055em !important;
  }

  body.user-page .bank-box b {
    display: block !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(13px, 3.8vw, 16px) !important;
    letter-spacing: -.035em !important;
  }

  body.user-page .panel form > .recharge-deposit-guide {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(7.8px, 2.1vw, 9px) !important;
    letter-spacing: -.055em !important;
  }

  body.user-page .my-info-heading p {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(8.7px, 2.4vw, 10.5px) !important;
    letter-spacing: -.045em !important;
  }

  body.user-page .withdraw-card .my-info-card-title p {
    display: block !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(8.2px, 2.25vw, 9.8px) !important;
    letter-spacing: -.05em !important;
  }

  body.user-page .guide-section#start h2,
  body.user-page .guide-section#charge h2,
  body.user-page .guide-section#order h2,
  body.user-page .guide-section#status h2 {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(12px, 3.35vw, 14.5px) !important;
    letter-spacing: -.055em !important;
  }

  body.user-page .academy-kicker {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(7.8px, 2.15vw, 9px) !important;
    letter-spacing: .035em !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.user-page .academy-hero h1,
  body.user-page .academy-hero h1 em {
    white-space: nowrap !important;
    word-break: keep-all !important;
  }

  body.user-page .academy-hero h1 {
    font-size: clamp(19px, 5.25vw, 22px) !important;
    letter-spacing: -.055em !important;
  }

  body.user-page .academy-guide,
  body.user-page .academy-guide-grid > article {
    padding-left: 13px !important;
    padding-right: 13px !important;
  }

  body.user-page .academy-guide-grid ul li,
  body.user-page .academy-process li span {
    white-space: nowrap !important;
    word-break: keep-all !important;
    font-size: clamp(7.5px, 2.1vw, 8.8px) !important;
    letter-spacing: -.055em !important;
  }

  body.user-page .academy-guide-grid ul li {
    padding-left: 16px !important;
  }

  body.user-page .academy-process li {
    gap: 7px !important;
  }

  body.user-page .academy-process li b {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
  }
  .my-info-card { padding: 18px !important; border-radius: 18px !important; box-shadow: 0 8px 24px rgba(36,43,83,.06) !important; }
  .point-card .my-info-card-title { border-bottom-color: rgba(255,255,255,.2) !important; }
  .point-card .my-info-icon { background: rgba(255,255,255,.18) !important; color: #fff !important; }
  .point-card .my-info-card-title h2 { color: #fff; }
  .point-card strong { margin-bottom: 2px !important; font-size: 30px !important; }
  .point-card strong em { color: rgba(255,255,255,.9) !important; }
  .my-info-list > div { grid-template-columns: 112px 1fr !important; padding: 14px 0 !important; }
  .my-info-list dd { font-size: 13px !important; }
  .password-form input { font-size: 16px !important; }

  .my-info-card-title h2,
  .my-info-card-title p,
  .point-actions a,
  .password-form label,
  .password-form button,
  .withdraw-details summary,
  .withdraw-confirm-help {
    word-break: keep-all;
  }
  .point-actions { grid-template-columns: 1fr 1fr !important; }
  .point-actions a { min-width: 0; padding: 0 7px; font-size: 12px; white-space: nowrap; }

  body.user-page main.main > header:first-child {
    align-items: flex-start;
    gap: 10px;
  }
  body.user-page main.main > header:first-child h1 { font-size: 25px; }
  body.user-page main.main > header:first-child p { font-size: 13px; }
  body.user-page main.main > header:first-child .balance {
    width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
  }

  html.pwa-tab-points body.user-page main.main > header:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    margin-bottom: 14px !important;
  }
  html.pwa-tab-points body.user-page main.main > header:first-child > div:first-child h1,
  html.pwa-tab-points body.user-page main.main > header:first-child > div:first-child p {
    margin-right: 0 !important;
  }
  html.pwa-tab-points body.user-page main.main > header:first-child > div:first-child p {
    margin-top: 5px !important;
    line-height: 1.45 !important;
    word-break: keep-all;
  }
  html.pwa-tab-points body.user-page main.main > header:first-child .balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0 !important;
    padding: 14px 16px !important;
  }
  html.pwa-tab-points body.user-page main.main > header:first-child .balance small,
  html.pwa-tab-points body.user-page main.main > header:first-child .balance b {
    margin: 0 !important;
    white-space: nowrap;
  }

  body.user-page main.main h1,
  body.user-page main.main h2,
  body.user-page main.main h3,
  body.user-page main.main label,
  body.user-page main.main button,
  body.user-page main.main .status,
  body.user-page main.main .section-title a,
  body.user-page main.main .section-title span {
    word-break: keep-all;
  }

  body.user-page .mobile-menu-toggle {
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }
}
