/* The browser installer: one card on the pairing screen's LCD ground. Tokens,
 * buttons and wells come from app.css; this file only lays out the page. */
.ins { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; overflow: clip;
  padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom));
  background: var(--entry-canvas, var(--canvas)); }
.ins-ground { position: absolute; inset: 0; pointer-events: none; }
.ins-ground .lcd { position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--lcd-dot, transparent) 0 1px, transparent 1.2px),
    repeating-linear-gradient(to bottom, var(--lcd-scan, transparent) 0 1px, transparent 1px 3px);
  background-size: 6px 6px, 100% 3px; }
.ins-ground .vignette { position: absolute; inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 45%, var(--lcd-vignette, transparent) 100%); }

.ins-wrap { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; }
.ins-card {
  position: relative; display: flex; flex-direction: column; text-align: center;
  padding: 32px 24px 24px; border-radius: var(--radius-3xl); border: 1px solid var(--glass-border);
  background: var(--entry-card, var(--glass-bg)); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: var(--entry-card-shadow, var(--shadow-glass));
}
@media (prefers-reduced-transparency: reduce) { .ins-card { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (min-width: 640px) { .ins-card { padding: 40px 40px 28px; } }

.view { display: flex; flex-direction: column; animation: ins-rise var(--dur-normal) var(--ease-dialog); }
@keyframes ins-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.ins-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 24px; display: grid; place-items: center;
  background: var(--glass-surface); color: var(--text-primary); box-shadow: 0 0 0 1px var(--glass-border); }
.ins-mark img { width: 56px; height: 56px; border-radius: 16px; display: block; }
.ins-mark .icon { width: 28px; height: 28px; }
.ins-mark.ok { color: var(--success); background: var(--success-muted); box-shadow: none; }
.ins-mark.bad { color: var(--error); background: var(--error-muted); box-shadow: none; }
.ins-card h1 { font-size: 22px; line-height: 28px; letter-spacing: -.02em; font-weight: 700; }
.ins-sub { margin-top: 6px; font-size: 15px; line-height: 22px; color: var(--text-secondary); text-wrap: pretty; }
.ins-sub b { color: var(--text-primary); font-weight: 600; }
.ins-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }

/* What happens: one quiet row under the button. */
.ins-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--glass-border); text-align: left; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.ins-note .well { width: 32px; height: 32px; border-radius: 12px; }
.ins-note .well .icon { width: 16px; height: 16px; }
.ins-note b { display: block; color: var(--text-primary); font-weight: 500; }

/* Progress */
.ins-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 2px; text-align: left; }
.ins-steps li { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-xl);
  font-size: 15px; color: var(--text-muted); }
.ins-steps li .dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--glass-border-light); display: grid; place-items: center; }
.ins-steps li .dot .icon { width: 12px; height: 12px; display: none; }
.ins-steps li .pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 14px; }
.ins-steps li.now { background: var(--glass-surface); color: var(--text-primary); font-weight: 500; }
.ins-steps li.now .dot { border-color: var(--text-primary); border-right-color: transparent; animation: spin 1s linear infinite; }
.ins-steps li.did { color: var(--text-secondary); }
.ins-steps li.did .dot { border-color: transparent; background: var(--cta); color: var(--on-cta); }
.ins-steps li.did .dot .icon { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ins-steps li.now .dot { animation: none; border-right-color: var(--text-primary); } }
.ins-bar { height: 6px; margin-top: 20px; border-radius: 3px; background: var(--bg-elevated); overflow: hidden; }
.ins-bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--cta); transition: width 300ms var(--ease-smooth); }
.ins-keep { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.ins-keep .icon { width: 16px; height: 16px; color: var(--warning); }

/* Done and errors */
.ins-next { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 14px 16px; border-radius: var(--radius-2xl);
  background: var(--glass-surface); text-align: left; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.ins-next .path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--text-primary); font-weight: 500; font-size: 15px; }
.ins-next .path .icon { width: 12px; height: 12px; color: var(--text-faint); }
.ins-fine { margin-top: 16px; font-size: 13px; line-height: 18px; color: var(--text-muted); text-wrap: pretty; overflow-wrap: anywhere; }
.ins-fine button { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; cursor: pointer; }
.ins-details { margin-top: 16px; text-align: left; }
.ins-details summary { cursor: pointer; font-size: 13px; color: var(--text-muted); list-style: none; text-align: center; }
.ins-details summary::-webkit-details-marker { display: none; }
.ins-details pre { margin: 8px 0 0; max-height: 160px; overflow: auto; padding: 12px; border-radius: var(--radius-md); background: var(--bg-inset);
  font: 12px/1.5 var(--font-mono); color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Browser without USB access: three small steps. */
.ins-list { list-style: none; counter-reset: s; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.ins-list li { counter-increment: s; display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-primary); }
.ins-list li::before { content: counter(s); width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-surface); color: var(--text-secondary); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Restore: the two files people pick. */
.ins-files { margin-top: 20px; display: grid; gap: 8px; text-align: left; }
.ins-file { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-xl);
  background: var(--glass-surface); font-size: 14px; color: var(--text-secondary); overflow-wrap: anywhere; }
.ins-file .icon { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.ins-file.ok .icon { color: var(--success); }
.ins-pick { position: relative; }
.ins-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.ins-links { display: flex; justify-content: center; gap: 4px 20px; flex-wrap: wrap; margin-top: 20px; }
.ins-links button, .ins-links a { font-size: 14px; color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.ins-links button:hover, .ins-links a:hover { color: var(--text-primary); }

.ins-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 16px; padding: 16px 0 0;
  font-size: 13px; line-height: 18px; color: var(--text-muted); }
.ins-foot a { color: inherit; text-decoration: none; }
.ins-foot a:hover { color: var(--text-primary); }
.ins-foot .fine { width: 100%; text-align: center; font-size: 12px; color: var(--text-faint); }
@media (min-width: 480px) { .ins-foot .fine { width: auto; } }

/* Focus moves to each view's heading for screen readers; it needs no ring. */
.ins-card h1:focus { outline: none; }
.ins a.btn { text-decoration: none; }
.ins-mark.ok, .ins-mark.bad { background: none; }
.ins-mark.ok .icon, .ins-mark.bad .icon { width: 44px; height: 44px; }

/* Connected: the device card leads the view in place of the mark. */
.ins-device { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 12px 14px; border-radius: var(--radius-2xl);
  background: var(--glass-surface); text-align: left; }
.ins-device-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ins-device-text b { font-size: 15px; line-height: 20px; font-weight: 600; }
.ins-device-text span { font-size: 14px; line-height: 20px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-pill { flex: none; padding: 2px 10px; border-radius: var(--radius-full); font-size: 13px; line-height: 20px; font-weight: 500;
  color: var(--success); background: var(--success-muted); }
.ins-check { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-2xl);
  border: 1px solid var(--glass-border); text-align: left; font-size: 14px; line-height: 20px; color: var(--text-secondary); cursor: pointer; }
.ins-check b { display: block; color: var(--text-primary); font-weight: 500; font-size: 15px; }
.ins-latest { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--text-muted); }

/* Less is more: pills under the card, a two-line footer, no dividers. */
.ins-wrap { gap: 12px; }
.ins-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ins-pills.one { grid-template-columns: 1fr; justify-items: center; }
.ins-pills.one .glass-pill { min-width: 140px; }
.ins-pills .glass-pill { cursor: pointer; }
#backBtn .icon { transform: scaleX(-1); }
.ins-foot { flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 0; }
.ins-credit { display: inline-flex; gap: 8px; align-items: baseline; }
.ins-credit > span { color: var(--text-faint); }
.ins-foot .fine, .ins-foot .fine { width: auto; font-size: 11px; line-height: 16px; }
.ins-latest { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.ins-device { margin-bottom: 20px; }
.ins-check { margin-top: 16px; padding: 10px 14px; justify-content: space-between; font-size: 15px; color: var(--text-primary); }
.ins-bar { margin-top: 24px; }
.ins-card .btn.ghost { color: var(--text-secondary); }
.ins-latest button { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ins-latest { overflow-wrap: anywhere; }
