/* ── Mobile responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    main { padding: 0.75rem 0.75rem 2rem; }

    .header-row {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
    }
    .header-row h1 {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    h1 { font-size: 1.5rem; }

    .btn { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
    .btn-small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

    .table-controls { gap: 0.3rem; }
    .search-input, .filter-select, .sort-select { font-size: 0.82rem; }

    /* Responsive button: show "+" only on mobile */
    .btn-label-short { display: inline; }
    .btn-label-full { display: none; }

    /* Hide gender & notes cols on mobile */
    .col-hide-mobile { display: none; }
    .table-collapsed .col-expand-mobile { display: none; }

    th, td { padding: 0.35rem 0.3rem; font-size: 0.82rem; }
    .guest-name-cell { white-space: nowrap; }
    .kebab-wrapper .kebab-btn { padding: 0.2rem 0.3rem; }

    .event-row-name { font-size: 0.92rem; }
    .event-row-location { font-size: 0.75rem; }
    .event-row-date { font-size: 0.72rem; }
    .badge { font-size: 0.62rem; padding: 0.08rem 0.4rem; }

    .summary-table th { font-size: 0.62rem; padding: 0.3rem 0.35rem; }
    .summary-table td { font-size: 0.78rem; padding: 0.3rem 0.35rem; }

    .detail-overlay {
        background: #f2f2f7;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        align-items: stretch;
    }
    .detail-card {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .detail-name-input { font-size: 0.95rem; }

    .form { padding: 1.25rem; }

    .form-row { flex-direction: column; gap: 0.5rem; }
    .modal-form .form-row { flex-direction: row; gap: 0.75rem; }

    .batch-bar { font-size: 0.8rem; padding: 0.4rem 0.6rem; }

    /* "+" buttons: 36x36 rounded square on mobile */
    .new-invite-icon-btn.btn-small,
    .btn:has(.btn-label-short) {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 10px;
        font-size: 1.1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Narrower name inputs in guest database */
    .inline-edit.ge-first,
    .inline-edit.ge-last {
        max-width: 90px;
    }

    /* Prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
    /* Keep inline table selects at table font size */
    .status-select,
    .inline-select {
        font-size: 0.82rem !important;
    }
}

/* Larger screens: center the detail card */
@media (min-width: 601px) {
    .detail-overlay {
        align-items: center;
    }

    .detail-card {
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    }
}
