/* Install page — mobile-first, single-column */

.install-body {
    background: linear-gradient(180deg, #f6f9fc, #ffffff);
    min-height: 100vh;
}

.ins-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.ins-top .brand { text-decoration: none; color: var(--text); }
.ins-help {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 6px 12px;
    border-radius: 8px;
}
.ins-help:hover { background: var(--brand-soft); }

.ins-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 22px 18px 60px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* States */
.ins-state {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 14px 32px -16px rgba(11,21,48,0.12);
}
.ins-state[hidden] { display: none; }

.ins-step-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}
.ins-step-badge.done {
    background: #ecfdf3;
    color: #16a34a;
}

.ins-state h1 {
    margin: 0 0 10px;
    font-size: 1.55rem;
    letter-spacing: -0.01em;
}
.ins-lead {
    margin: 0 0 22px;
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 1rem;
}

/* CTA buttons */
.ins-cta-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
    margin-bottom: 16px;
}
.ins-cta-btn:active { transform: translateY(1px); }
.ins-cta-btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 12px 24px -10px rgba(30,99,216,0.5);
}
.ins-cta-btn:not(.primary):hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}
.ins-cta-btn .cta-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--brand);
}
.ins-cta-btn.primary .cta-icon { background: rgba(255,255,255,0.18); color: #fff; }
.ins-cta-btn span:nth-child(2) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.ins-cta-btn strong { font-size: 1.02rem; font-weight: 700; }
.ins-cta-btn small {
    font-size: 0.82rem;
    color: var(--text-dim);
}
.ins-cta-btn.primary small { color: rgba(255,255,255,0.85); }

.ins-next-btn {
    width: 100%;
    padding: 13px 18px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 6px;
    font-family: inherit;
}
.ins-next-btn:hover { background: var(--brand-dark); }

.ins-secondary {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 8px;
    border-radius: 8px;
}
.ins-secondary:hover { color: var(--brand); }

/* Note (unknown sources explainer) */
.ins-quick-steps {
    margin: 16px 0 14px;
    padding: 14px 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    list-style-position: outside;
    padding-inline-start: 36px;
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.65;
}
.ins-quick-steps li { padding: 4px 0; }
.ins-quick-steps li strong { color: var(--text); font-weight: 700; }

.ins-note {
    margin: 12px 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.ins-note summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    font-size: 0.94rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ins-note summary::-webkit-details-marker { display: none; }
.ins-note summary span { color: var(--brand); font-size: 1rem; }
.ins-note p { margin: 12px 0 8px; color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; }
.ins-note ol { margin: 0; padding-inline-start: 1.4em; color: var(--text-dim); font-size: 0.9rem; }
.ins-note ol li { padding: 3px 0; }

.ins-note-warn {
    background: #fef3c7;
    border-color: #f59e0b;
}
.ins-note-warn summary {
    color: #92400e;
}
.ins-note-warn[open] summary {
    border-bottom: 1px solid #fcd34d;
    padding-bottom: 10px;
    margin-bottom: 4px;
}
.ins-note-warn p > strong:first-child { color: #92400e; }
.ins-note-warn code { background: rgba(146,64,14,0.1); padding: 1px 6px; border-radius: 4px; }

/* Pre-install banner — Play Protect warning */
.pre-install-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fef3c7, #fff3cd);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.pib-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.pre-install-banner > div:last-child { flex: 1; }
.pre-install-banner strong {
    color: #92400e;
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}
.pre-install-banner p {
    margin: 0;
    color: #78350f;
    font-size: 0.92rem;
    line-height: 1.5;
}
.pib-details { margin-top: 10px; }
.pib-details summary {
    cursor: pointer;
    color: #92400e;
    font-weight: 600;
    font-size: 0.92rem;
    list-style: none;
    padding: 6px 0;
}
.pib-details summary::-webkit-details-marker { display: none; }
.pib-details ol {
    margin: 8px 0;
    padding-inline-start: 1.4em;
    color: #78350f;
    font-size: 0.92rem;
    line-height: 1.7;
}
.pib-tip {
    margin-top: 8px !important;
    padding: 8px 12px;
    background: rgba(146,64,14,0.08);
    border-radius: 6px;
    font-size: 0.85rem !important;
}

.post-install-step {
    background: linear-gradient(135deg, #ecfdf3, #f0fdf9);
    border: 1px solid #22c55e;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 14px 0 18px;
}
.post-install-step strong:first-child {
    display: block;
    color: #14532d;
    margin-bottom: 8px;
    font-size: 1rem;
}
.post-install-step ol {
    margin: 0;
    padding-inline-start: 1.4em;
    color: #166534;
    font-size: 0.94rem;
    line-height: 1.7;
}
.post-install-step ol li strong { color: #14532d; }
.pos-tip {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: rgba(146,64,14,0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    color: #78350f;
    font-size: 0.86rem;
}

/* Token row */
.ins-token-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.token-label { color: var(--text-dim); font-size: 0.78rem; font-weight: 600; margin-bottom: 3px; }
.token-code {
    direction: ltr;
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.06em;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 600;
}
.token-copy {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 7px 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
}
.token-copy:hover { border-color: var(--brand); color: var(--brand); }

.ins-tiny {
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    margin: 4px 0 0;
}
.ins-tiny a { color: var(--brand); text-decoration: none; }

/* Flow progress */
.ins-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    justify-content: center;
}
.flow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
}
.flow-step span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1.5px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.85rem;
}
.flow-step.active span {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.flow-step.active { color: var(--text); }
.flow-step.done span {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.flow-step.done span::before { content: "✓"; }
.flow-step.done span:not(:empty) { font-size: 0; }
.flow-step.done span::after { font-size: 0.85rem; }
.flow-line {
    flex: 1;
    max-width: 36px;
    height: 1.5px;
    background: var(--border-strong);
}

/* Help box */
.ins-help-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
}
.ins-help-box h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}
.ins-help-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ins-help-box li {
    color: var(--text-dim);
    font-size: 0.94rem;
    line-height: 1.55;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
.ins-help-box li:last-child { border-bottom: none; }
.ins-help-box li strong { color: var(--text); }
.ins-help-box a { color: var(--brand); text-decoration: none; }

@media (min-width: 720px) {
    .ins-main { max-width: 560px; }
    .ins-state h1 { font-size: 1.8rem; }
}

/* Pair page (web-side QR display) */
.pair-main { max-width: 720px; }
.pair-card { padding: 36px 32px; }
.pair-qr-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: center;
    background: var(--bg-soft);
    border-radius: 14px;
    padding: 24px;
    margin: 18px 0;
}
.pair-qr-frame {
    width: 240px;
    height: 240px;
    padding: 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 32px -12px rgba(15,30,60,0.18);
}
.pair-qr-frame svg { width: 100%; height: 100%; display: block; }

.pair-info { display: flex; flex-direction: column; gap: 14px; }
.pair-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 1rem;
}
.pulse-dot {
    width: 12px; height: 12px;
    background: var(--brand);
    border-radius: 50%;
    animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(30,99,216,0.4); }
    70% { box-shadow: 0 0 0 14px rgba(30,99,216,0); }
    100% { box-shadow: 0 0 0 0 rgba(30,99,216,0); }
}
.pair-meta { display: flex; flex-direction: column; gap: 10px; }
.pair-meta > div { display: flex; flex-direction: column; gap: 2px; }
.pair-meta span { color: var(--text-dim); font-size: 0.82rem; font-weight: 600; }
.pair-meta code {
    color: var(--text);
    font-family: 'Fira Code', monospace;
    background: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    letter-spacing: 0.05em;
    font-size: 0.92rem;
}
.pair-meta strong { color: var(--text); font-size: 1.1rem; }
.pair-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pair-secondary { padding: 22px 26px; }
.pair-h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--text); }
.pair-secondary p { margin: 0 0 12px; color: var(--text-dim); font-size: 0.94rem; }
.pair-share { display: flex; gap: 10px; flex-wrap: wrap; }
.pair-share .share-btn { font-size: 0.92rem; }

@media (max-width: 640px) {
    .pair-qr-wrap { grid-template-columns: 1fr; gap: 18px; justify-items: center; }
    .pair-info { width: 100%; }
}
