.fanclub-pwa, .fanclub-pwa *, .pwa-update, .pwa-update * { box-sizing: border-box; }
.pwa-mobile-copy { display: none; }
.fanclub-pwa, .pwa-update {
  font-family: IRANSansX, Tahoma, Arial, sans-serif;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.8;
  text-align: right;
}
.fanclub-pwa [hidden], .fanclub-pwa[hidden] { display: none !important; }
.fanclub-pwa { position: fixed; z-index: 70; left: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); max-width: min(360px, calc(100vw - 24px)); }
.fanclub-pwa button, .pwa-update button { cursor: pointer; font: inherit; font-weight: 700; border: 0; }
.fanclub-pwa button:focus-visible, .pwa-update button:focus-visible { outline: 3px solid #fbbf24; outline-offset: 4px; }
.pwa-trigger { display: flex; align-items: center; gap: 8px; border: 1px solid #475569 !important; border-radius: 12px; padding: 8px 14px; background: #0f172a; color: #f8fafc; box-shadow: 0 8px 24px #0004; }
.pwa-trigger span { color: #fbbf24; font-size: 20px; line-height: 1; }
.pwa-banner { width: 360px; max-width: 100%; position: relative; padding: 18px; background: #0f172a; border: 1px solid #475569; border-radius: 16px; box-shadow: 0 16px 48px #0005; }
.pwa-brand { display: flex; align-items: center; gap: 12px; padding-left: 18px; }
.pwa-brand img, .pwa-dialog > img { border-radius: 12px; }
.pwa-brand strong { font-size: 14px; font-weight: 700; }
.pwa-message { margin: 12px 0; color: #cbd5e1; }
.pwa-dismiss, .pwa-close { position: absolute; top: 8px; left: 8px; min-width: 36px; min-height: 36px; color: #cbd5e1; background: transparent; font-size: 22px !important; border-radius: 8px; }
.pwa-primary { padding: 9px 16px; border-radius: 10px; background: #fbbf24; color: #020617; min-height: 42px; }
.pwa-primary:disabled { opacity: .6; cursor: wait; }
.pwa-later { background: transparent; color: #cbd5e1; padding: 9px 12px; min-height: 42px; }
.pwa-dialog { box-sizing: border-box; position: fixed; margin: auto; padding: 26px; width: min(430px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #475569; border-radius: 18px; background: #0f172a; color: #f8fafc; font: inherit; text-align: right; box-shadow: 0 24px 80px #0006; }
.pwa-dialog::backdrop { background: #020617b3; backdrop-filter: blur(3px); }
.pwa-dialog h2 { font-size: 17px; font-weight: 700; margin: 14px 0 10px; }
.pwa-guide-description, .pwa-steps { color: #cbd5e1; }
.pwa-steps { padding-right: 20px; margin: 16px 0; }
.pwa-steps li { padding-right: 4px; margin: 10px 0; }
.pwa-feedback { color: #fbbf24; }
.pwa-update { position: fixed; z-index: 80; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; width: fit-content; max-width: calc(100vw - 24px); margin: auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #0f172a; border: 1px solid #475569; border-radius: 12px; box-shadow: 0 10px 30px #0004; }
.pwa-update button { color: #fbbf24; background: transparent; min-height: 36px; }
[data-pwa-bottom-nav] { bottom: 0 !important; padding-bottom: calc(.375rem + env(safe-area-inset-bottom, 0px)); }
/* Installed WebKit can under-report viewport units. Anchor the frame to its edges. */
.fanclub-app-active, .fanclub-app-active body { height: 100%; min-height: 0; overflow: hidden; }
.fanclub-app-active #root { position: fixed; inset: 0; height: var(--fanclub-frame-height, auto); min-height: 0; overflow: hidden; }
.fanclub-app-shell { box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-width: 0; overflow: hidden; }
.fanclub-fan-content { width: 100%; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain; padding-bottom: 24px; }
/* The shell owns the top inset; the bottom navigation owns the bottom inset. */
html[data-pwa-display="standalone"].fanclub-app-active body { padding: 0; }
html[data-pwa-display="standalone"] .fanclub-app-shell { padding-top: env(safe-area-inset-top, 0px); }
.fanclub-sections > summary { list-style: none; }
.fanclub-sections > summary::-webkit-details-marker { display: none; }
.fanclub-sections[open] .fanclub-sections-chevron { transform: rotate(180deg); }
.fanclub-sections nav { max-height: min(45dvh, max(48px, calc(100dvh - 260px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)))); overflow-y: auto; overscroll-behavior-y: contain; }
@media (max-width: 1023px) {
  #root .fan-login-screen input,
  #root .fanclub-app-shell input:not([type="checkbox"]):not([type="radio"]),
  #root .fanclub-app-shell textarea,
  #root .fanclub-app-shell select { font-size: 16px; }
}
html[data-pwa-display="standalone"] body { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (max-width: 1023px) {
  .fanclub-pwa[data-bottom-nav="true"] { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  .fanclub-pwa { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .pwa-banner { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 12px 12px 12px 44px; border-radius: 12px; }
  .pwa-brand { display: contents; }
  .pwa-brand img { width: 32px; height: 32px; grid-column: 1; grid-row: 1 / 3; border-radius: 8px; }
  .pwa-brand strong { grid-column: 2; grid-row: 1; font-size: 13px; line-height: 1.6; }
  .pwa-message { grid-column: 2; grid-row: 2; margin: 0; font-size: 11px; line-height: 1.6; }
  .pwa-desktop-copy { display: none; }
  .pwa-mobile-copy { display: inline; }
  .pwa-install-action { grid-column: 3; grid-row: 1 / 3; padding: 8px 10px; font-size: 12px !important; white-space: nowrap; }
  .pwa-later { display: none; }
  .pwa-dismiss { top: 50%; left: 0; min-width: 44px; min-height: 44px; transform: translateY(-50%); }
  .pwa-update { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 6px; padding: 6px 10px; font-size: 12px; }
  .pwa-update button { min-height: 44px; }
}
