/* Luckline Cross-Platform App Install UI (iOS / Android / Desktop) */

@media all and (display-mode: standalone) {
  body header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(78px + env(safe-area-inset-top, 0px));
  }
  body #sidebar {
    padding-top: calc(29px + env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 760px) and (display-mode: standalone) {
  body header {
    height: calc(66px + env(safe-area-inset-top, 0px));
  }
}

.pwa-side-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: calc(100% + 24px);
  margin: 0 -12px 16px;
  padding: 9px 10px;
  border: 1px solid #b2ee7538;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b3123a8, #121e28cc);
  color: #edf5f0;
  text-align: left;
  box-shadow: inset 0 1px 0 #ffffff0d;
  transition: border-color .18s, background .18s, transform .15s;
}

.pwa-side-card:hover {
  border-color: #b2ee7588;
  background: linear-gradient(135deg, #233f2ccc, #162531eb);
  transform: translateY(-1px);
}

.pwa-side-card img,
.pwa-side-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px #00000070;
}

.pwa-side-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pwa-side-text strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #f4faee;
  line-height: 1.25;
}

.pwa-side-text small {
  font-size: 9.5px;
  color: #9ec09f;
  line-height: 1.25;
  letter-spacing: -.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-side-badge {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid #b2ee7542;
  background: #b2ee751a;
  color: #c7fc88;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .18s, border-color .18s, transform .15s;
}

.pwa-side-card:hover .pwa-side-badge {
  background: #b2ee7530;
  border-color: #b2ee7588;
  color: #dcffaf;
}

/* Footer link */
.pwa-footer-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.pwa-footer-btn:hover {
  color: #b2ee75;
}

/* Subtle non-blocking browse banner */
.pwa-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(372px, calc(100vw - 24px));
  padding: 11px 12px 11px 13px;
  border: 1px solid #b2ee754d;
  border-radius: 15px;
  background: linear-gradient(145deg, #172721f7, #101b25fa);
  box-shadow: 0 18px 46px #00000099, inset 0 1px 0 #ffffff14;
  color: #eef5f1;
}

.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px #0006;
}

.pwa-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.pwa-banner-copy strong {
  font-size: 12px;
  font-weight: 700;
  color: #f5faf2;
  line-height: 1.3;
}

.pwa-banner-copy span {
  font-size: 10px;
  color: #97afb3;
  line-height: 1.35;
}

.pwa-banner-cta {
  flex-shrink: 0;
  border: 0;
  border-radius: 9px;
  background: #b2ee75;
  color: #132215;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 800;
  transition: background .16s, transform .14s;
}

.pwa-banner-cta:hover {
  background: #c8ff8f;
  transform: translateY(-1px);
}

.pwa-banner-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #ffffff0a;
  color: #93a4b5;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.pwa-banner-close:hover {
  background: #ffffff1a;
  color: #fff;
}

@media (max-width: 760px) {
  .pwa-banner {
    left: 12px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    gap: 10px;
    padding: 10px 11px;
  }
}

@media (max-width: 390px) {
  .pwa-banner {
    gap: 9px;
    padding: 9px 10px;
  }
  .pwa-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .pwa-banner-cta {
    padding: 8px 11px;
  }
}

@media (max-width: 520px) {
  .pwa-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
  }
  .pwa-dialog-head {
    padding: 16px 16px 12px;
    gap: 10px;
  }
  .pwa-dialog-title {
    gap: 11px;
    min-width: 0;
  }
  .pwa-app-preview {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .pwa-dialog-title h2 {
    font-size: 16.5px;
    line-height: 1.2;
  }
  .pwa-dialog-body {
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .pwa-tabs button {
    font-size: 11px;
    padding: 9px 4px;
    white-space: nowrap;
  }
  .pwa-step {
    padding: 11px;
    gap: 10px;
  }
}

/* Modal dialog */
.pwa-dialog {
  box-sizing: border-box;
  width: min(500px, calc(100vw - 26px));
  max-width: 500px;
  max-height: min(680px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #6e8d8048;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0, #b2ee751c, transparent 58%), #121c26;
  color: #edf3f7;
  box-shadow: 0 32px 100px #000a;
}

.pwa-dialog[open] {
  display: flex;
  flex-direction: column;
}

.pwa-dialog::backdrop {
  background: #030912c7;
  backdrop-filter: blur(8px);
}

.pwa-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #ffffff0d;
}

.pwa-dialog-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.pwa-app-preview {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid #b2ee754d;
  box-shadow: 0 10px 24px #0008, 0 0 0 1px #ffffff14;
  flex-shrink: 0;
}

.pwa-dialog-title .eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #b2ee75;
  margin-bottom: 3px;
}

.pwa-dialog-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.4px;
  color: #f6faf6;
}

.pwa-dialog-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #ffffff12;
  background: #ffffff0a;
  color: #cfe0dc;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}

.pwa-dialog-close:hover {
  background: #ffffff18;
  color: #fff;
}

.pwa-dialog-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
}

.pwa-native-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  margin-bottom: 16px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #c2ff7e, #98df4d);
  color: #102316;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px #b2ee7538;
}

.pwa-native-cta:hover {
  filter: brightness(1.05);
}

.pwa-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 11px;
  background: #0b121b;
  border: 1px solid #ffffff10;
  margin-bottom: 16px;
}

.pwa-tabs button {
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  background: transparent;
  color: #8ea3b5;
  font-size: 11px;
  font-weight: 700;
  transition: background .15s, color .15s;
}

.pwa-tabs button.active {
  background: #1d2c3b;
  color: #f0f7ed;
  box-shadow: 0 2px 6px #0004;
}

.pwa-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  background: #0d1620;
  border: 1px solid #ffffff0d;
}

.pwa-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #b2ee751f;
  border: 1px solid #b2ee7555;
  color: #b2ee75;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-step-copy {
  flex: 1;
  min-width: 0;
}

.pwa-step-copy > strong {
  display: block;
  font-size: 13px;
  color: #eef5f2;
  margin-bottom: 3px;
}

.pwa-step-copy > span {
  display: block;
  font-size: 11px;
  line-height: 1.55;
  color: #95a9b8;
}

.pwa-step-copy > span strong {
  color: #e4f2eb;
  font-weight: 700;
}

.pwa-inline-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #ffffff14;
  color: #d7f7aa;
  margin: 0 2px;
}

.pwa-inline-ico svg {
  width: 13px;
  height: 13px;
}

.pwa-note {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: #849bad;
  text-align: center;
}

html[dir=rtl] .pwa-side-card {
  text-align: right;
}

html[dir=rtl] .pwa-side-badge {
  margin-left: 0;
  margin-right: auto;
}
