/* AmaJova Smart Install Assistant — shared foundation */
:root {
  --aj-install-green: #0B6B46;
  --aj-install-green-dark: #085438;
  --aj-install-text: #163024;
  --aj-install-muted: #5d6f65;
  --aj-install-border: #dfe7e2;
  --aj-install-surface: #ffffff;
  --aj-install-overlay: rgba(3, 18, 10, 0.46);
}

.aj-install-lock {
  overflow: hidden !important;
}

.aj-install-assistant[hidden] {
  display: none !important;
}

.aj-install-assistant {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: var(--aj-install-overlay);
  backdrop-filter: blur(3px);
}

.aj-install-dialog {
  width: min(100%, 520px);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--aj-install-border);
  border-radius: 24px 24px 18px 18px;
  background: var(--aj-install-surface);
  color: var(--aj-install-text);
  box-shadow: 0 24px 80px rgba(6, 35, 19, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.aj-install-drag {
  width: 44px;
  height: 5px;
  margin: -8px auto 18px;
  border-radius: 999px;
  background: #d8e2dc;
}

.aj-install-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.aj-install-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: #eef7f2;
}

.aj-install-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aj-install-heading-wrap {
  min-width: 0;
  flex: 1;
}

.aj-install-title {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.aj-install-description {
  margin: 8px 0 0;
  color: var(--aj-install-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.aj-install-close {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--aj-install-border);
  border-radius: 999px;
  background: #fff;
  color: var(--aj-install-text);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.aj-install-body {
  margin-top: 20px;
}

.aj-install-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.aj-install-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.aj-install-button-primary {
  background: var(--aj-install-green);
  color: #fff;
}

.aj-install-button-primary:hover {
  background: var(--aj-install-green-dark);
}

.aj-install-button-secondary {
  border-color: var(--aj-install-border);
  background: #fff;
  color: var(--aj-install-text);
}

.aj-install-close:focus-visible,
.aj-install-button:focus-visible {
  outline: 3px solid rgba(11, 107, 70, 0.28);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  .aj-install-assistant {
    align-items: center;
    padding: 24px;
  }

  .aj-install-dialog {
    padding: 30px;
    border-radius: 24px;
  }

  .aj-install-drag {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .aj-install-dialog {
    animation: aj-install-enter 180ms ease-out;
  }

  @keyframes aj-install-enter {
    from { opacity: 0; transform: translateY(18px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* P1G-C — Android and desktop native installation content */
.aj-install-native-copy {
  color: var(--aj-install-muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.aj-install-native-copy p {
  margin: 0;
}

.aj-install-native-copy ul {
  margin: 14px 0 0;
  padding-left: 1.25rem;
}

.aj-install-native-copy li + li {
  margin-top: 7px;
}

.aj-install-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

/* P1G-D — iPhone, iPad and in-app browser guidance */
.aj-install-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aj-install-steps li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--aj-install-border);
  border-radius: 16px;
  background: #f8fbf9;
}

.aj-install-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--aj-install-green);
  color: #fff;
  font-weight: 800;
}

.aj-install-steps strong,
.aj-install-browser-guide strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.aj-install-steps small {
  display: block;
  margin-top: 4px;
  color: var(--aj-install-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.aj-install-guidance-note {
  margin: 16px 0 0;
  padding: 13px 14px;
  border-radius: 14px;
  background: #eef7f2;
  color: var(--aj-install-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.aj-install-browser-guide {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--aj-install-border);
  border-radius: 16px;
  background: #f8fbf9;
}

.aj-install-browser-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--aj-install-green);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
}

.aj-install-browser-guide p {
  margin: 6px 0 0;
  color: var(--aj-install-muted);
  font-size: 0.91rem;
  line-height: 1.5;
}

/* P1G-D.1 — approved iOS guidance polish */
.aj-install-steps li {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.aj-install-step-copy {
  min-width: 0;
}

.aj-install-step-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 1px solid var(--aj-install-border);
  border-radius: 13px;
  background: #fff;
  color: #0a67d8;
  box-shadow: 0 5px 16px rgba(15, 45, 30, 0.08);
}

.aj-install-step-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 390px) {
  .aj-install-steps li {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .aj-install-step-icon {
    width: 40px;
    height: 40px;
  }
}

/* P1G-E — smart display manual entry */
.aj-install-manual-entry {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2147482000;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(11, 107, 70, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--aj-install-green);
  box-shadow: 0 10px 28px rgba(6, 35, 19, 0.16);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.aj-install-manual-entry[hidden] {
  display: none !important;
}

.aj-install-manual-entry svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aj-install-manual-entry:hover {
  background: #f4faf7;
}

.aj-install-manual-entry:focus-visible {
  outline: 3px solid rgba(11, 107, 70, 0.28);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .aj-install-manual-entry {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 10px 13px;
  }
}
