/* ── Quick Overview Navigator ── */
/* Tappable drill-down diagram built on the real keypad legend artwork and
   real app screenshots (see overview/img/en/) — no CSS-drawn calculator
   mock here. */

/* ── Keypad overview (app screenshot, overview/img/en/keypad-overview.png) ──
   The screenshot is 1:2 (600x1200), so width is also capped by the viewport
   height left after the header, title and intro (~300px on phones): half
   of that is the width that keeps the whole keypad on one iPhone screen. Zone percentages are each section's
   bounding box in the source image (display 31–741, scale/unit rows
   804–1353, keypad 1403–2368 of 2400px; x 45–1155 of 1200px), padded
   ~15px. The screenshot has no section markings of its own, so each zone
   draws a faint outline to show the three tappable areas. */
.legend-wrap {
    position: relative; margin: 0 auto;
    width: min(100%, 340px, max(120px, (100vh - 300px) / 2));
    width: min(100%, 340px, max(120px, (100svh - 300px) / 2));
}
.legend-wrap img { width: 100%; height: auto; display: block; border-radius: 12px; }
.legend-zone {
    position: absolute; left: 2.5%; width: 95%;
    display: block; text-decoration: none;
    border-radius: 8px;
    outline: 2px dashed color-mix(in srgb, var(--clr-accent) 70%, transparent);
    outline-offset: -2px;
}
.legend-zone:hover, .legend-zone:focus-visible {
    outline: 4px solid var(--clr-accent);
    outline-offset: 0;
}

/* ── Panels ── */
.nav-panel { display: none; }
.nav-panel.active { display: block; }

/* Keeps a scrolled-to panel clear of the sticky header. */
#navigator-diagram { scroll-margin-top: 72px; }
/* Header is two rows tall on phones (see style.css). */
@media (max-width: 640px) {
    #navigator-diagram { scroll-margin-top: 104px; padding-top: 1.25rem; }
    /* Panels are nested sections; drop their own top padding so it doesn't
       stack on the container's and push the keypad off screen. */
    #navigator-diagram .nav-panel { padding-top: 0; }
}

.panel-intro { color: var(--clr-muted); margin-bottom: 1.5rem; max-width: 560px; }

.back-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--clr-card); border: 1px solid var(--clr-border);
    border-radius: 10px; padding: .5rem 1rem; min-height: 44px;
    font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--clr-text);
    margin-bottom: 1.25rem;
}
.back-btn:hover { background: var(--clr-border); }

@media (min-width: 720px) {
    .legend-wrap {
        width: min(100%, 380px, max(120px, (100vh - 300px) / 2));
        width: min(100%, 380px, max(120px, (100svh - 300px) / 2));
    }
}
