/* ══════════════════════════════════════════════════════════════
   Page Guide — Floating "?" button + dialog overlay
   Apple-level polish: smooth transitions, focus states, tokens
   ══════════════════════════════════════════════════════════════ */

.gi-page-guide-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.06),
        0 8px 24px rgba(0,0,0,0.08);
    transition: background 200ms ease, color 200ms ease,
                border-color 200ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .gi-page-guide-fab {
    right: auto;
    left: 1.5rem;
}

.gi-page-guide-fab:hover {
    background: rgba(29, 66, 111, 0.06);
    color: #1d426f;
    border-color: #1d426f;
    transform: scale(1.08);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        0 12px 32px rgba(0,0,0,0.12);
}

.gi-page-guide-fab:focus-visible {
    outline: 2px solid #1d426f;
    outline-offset: 2px;
}

.gi-page-guide-fab:active {
    transform: scale(0.95);
}

.gi-page-guide-fab--add {
    width: auto;
    padding: 0.6rem 1rem 0.6rem 0.75rem;
    border-style: dashed;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    animation: gi-page-guide-fab-in 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-page-guide-fab--add:hover {
    border-style: solid;
}

.gi-page-guide-fab--edit {
    bottom: 4.5rem;
    width: auto;
    padding: 0.6rem 1rem 0.6rem 0.75rem;
    border-style: dashed;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    animation: gi-page-guide-fab-in 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-page-guide-fab--edit:hover {
    border-style: solid;
}

.gi-page-guide-fab__label {
    white-space: nowrap;
}

@keyframes gi-page-guide-fab-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Overlay ───────────────────────────────────────────── */

.gi-page-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1200;
    backdrop-filter: blur(3px);
    animation: gi-page-guide-backdrop-in 200ms ease-out;
}

/* ── Dialog ────────────────────────────────────────────── */

.gi-page-guide-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 8px 16px rgba(0,0,0,0.04),
        0 32px 64px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: gi-page-guide-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-page-guide-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0;
}

.gi-page-guide-dialog__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.gi-page-guide-dialog__close-x {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 150ms ease, color 150ms ease;
}

.gi-page-guide-dialog__close-x:hover {
    background: #f3f4f6;
    color: #111827;
}

.gi-page-guide-dialog__close-x:focus-visible {
    outline: 2px solid #1d426f;
    outline-offset: 2px;
}

.gi-page-guide-dialog__body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    font-size: 0.975rem;
    color: #4b5563;
    line-height: 1.7;
    white-space: pre-line;
}

.gi-page-guide-dialog__footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.5rem 1.25rem;
}

[dir="rtl"] .gi-page-guide-dialog__footer {
    justify-content: flex-start;
}

.gi-page-guide-dialog__close-btn {
    min-width: 96px;
}

.gi-page-guide-dialog__close-btn:focus-visible {
    outline: 2px solid #1d426f;
    outline-offset: 2px;
}

/* ── Animations ────────────────────────────────────────── */

@keyframes gi-page-guide-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gi-page-guide-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
    .gi-page-guide-fab {
        bottom: 1rem;
        right: 1rem;
    }
    [dir="rtl"] .gi-page-guide-fab {
        right: auto;
        left: 1rem;
    }
    .gi-page-guide-fab--edit {
        bottom: 4rem;
    }
    .gi-page-guide-dialog {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px;
    }
    .gi-page-guide-dialog__header {
        padding: 1rem 1.25rem 0;
    }
    .gi-page-guide-dialog__body {
        padding: 0.875rem 1.25rem;
    }
    .gi-page-guide-dialog__footer {
        padding: 0.75rem 1.25rem 1rem;
    }
}
