/* ============================================
   iOS "Add to Home Screen" instructions sheet
   ============================================ */
.pwa-ios-sheet {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.pwa-ios-sheet-visible { opacity: 1; pointer-events: auto; }

.pwa-ios-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(2px);
}

.pwa-ios-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary, #fff);
    color: var(--text-primary, #1e1b29);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 1.25rem 2rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(.32, .72, 0, 1);
}
.pwa-ios-sheet-visible .pwa-ios-card { transform: translateY(0); }

@media (min-width: 640px) {
    .pwa-ios-sheet { align-items: center; }
    .pwa-ios-card { border-radius: 16px; transform: translateY(20px) scale(0.98); }
    .pwa-ios-sheet-visible .pwa-ios-card { transform: translateY(0) scale(1); }
}

.pwa-ios-card h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.pwa-ios-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}
.pwa-ios-close:hover { background: rgba(0, 0, 0, 0.06); }

.pwa-ios-lead {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary, rgba(30,27,41,0.7));
}
.pwa-ios-target {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}
.pwa-ios-steps {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary, #1e1b29);
}
.pwa-ios-steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem 0;
}
.pwa-ios-step-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 0.05rem;
}
.pwa-ios-step-body { flex: 1; }
.pwa-ios-glyph {
    vertical-align: -3px;
    color: #2ba8ff;
    margin: 0 0.15rem;
}

.pwa-ios-note {
    font-size: 0.82rem;
    color: var(--text-secondary, rgba(30, 27, 41, 0.65));
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.pwa-ios-done {
    width: 100%;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.pwa-ios-done:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

@media (prefers-color-scheme: dark) {
    .pwa-ios-card { background: #1f1b29; color: #f3eee4; }
    .pwa-ios-steps { color: #f3eee4; }
    .pwa-ios-note { color: rgba(243, 238, 228, 0.65); }
    .pwa-ios-close { color: rgba(243, 238, 228, 0.65); }
    .pwa-ios-close:hover { background: rgba(255, 255, 255, 0.06); }
}

/* ============================================
   Header-level install button (rendered by partials.header-install-button)
   ============================================ */
.pwa-install-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 0.5rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    padding: 0;
    /* Subtle accent so the install affordance reads as a CTA without
       shouting. Hidden state still wins (hidden attribute removes from
       layout) so we don't fight the JS-controlled visibility. */
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); /* placeholder for transition */
}
.pwa-install-header-btn:hover {
    color: var(--text-primary, #1f2937);
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.pwa-install-header-btn[hidden] { display: none !important; }
@media (max-width: 640px) {
    .pwa-install-header-btn { width: 30px; height: 30px; }
}
