* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

:root {
    /* iOS System Colors */
    --ios-blue: #007AFF;
    --ios-blue-dark: #0051D5;
    --ios-blue-light: #5AC8FA;
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-orange: #FF9500;
    --ios-yellow: #FFCC00;
    --ios-purple: #AF52DE;
    --ios-pink: #FF2D55;
    
    /* iOS System Grays */
    --ios-gray-1: #8E8E93;
    --ios-gray-2: #AEAEB2;
    --ios-gray-3: #C7C7CC;
    --ios-gray-4: #D1D1D6;
    --ios-gray-5: #E5E5EA;
    --ios-gray-6: #F2F2F7;
    
    /* Legacy support */
    --primary-color: #007AFF;
    --primary-dark: #0051D5;
    --secondary-color: #34C759;
    --background: #FFFFFF;
    --surface: #F2F2F7;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --error: #FF3B30;
    --success: #34C759;
    --warning: #FF9500;
    --border-radius: 14px;
    --border-radius-sm: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --touch-min: 44px;
    --header-h: 88px;
    --bottom-nav-h: 83px;
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
    --safe-left: env(safe-area-inset-left, 0);
    --safe-right: env(safe-area-inset-right, 0);
    /* אייפון – גובה header כולל נוטש */
    --header-h-actual: calc(var(--header-h) + var(--safe-top));
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
    /* iOS: stable viewport so flex layout works */
    min-height: 100%;
    min-height: -webkit-fill-available;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Heebo', 'Assistant', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--surface);
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 17px;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: 100%;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    padding-bottom: var(--safe-bottom);
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    /* iOS: prevent pull-to-refresh / overscroll from breaking layout */
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* Import Hebrew fonts */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&family=Assistant:wght@300;400;500;600;700&display=swap');

.container {
    max-width: 100%;
    width: 100%;
    padding: 0 16px;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (min-width: 600px) {
    .container {
        padding: 0 20px;
        max-width: 600px;
    }
}

@media (min-width: 960px) {
    .container {
        max-width: 960px;
        padding: 0 24px;
    }
}

/* Header – iOS Style Large Title */
.header {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: var(--text-primary);
    padding: 0;
    padding-top: max(0px, var(--safe-top));
    padding-bottom: 0;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--header-h);
    min-height: max(var(--header-h), calc(88px + var(--safe-top)));
    display: flex;
    align-items: flex-end;
    width: 100%;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    padding-bottom: 8px;
    width: 100%;
}

.header h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.374px;
    line-height: 41px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    margin: 0;
    padding: 0 16px;
    padding-top: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

/* מצב הופעה – מופיע/ה למפגשים (גלוי) */
.visibility-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    padding: 6px 12px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 20px;
    border: none;
    color: var(--ios-blue);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

.visibility-status:hover {
    background: rgba(0, 122, 255, 0.15);
}
.visibility-status {
    -webkit-tap-highlight-color: transparent;
}

.visibility-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.visibility-status.visible .visibility-dot {
    background: var(--success);
}

.visibility-status.not-visible .visibility-dot {
    background: var(--warning);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    padding: 6px 12px;
    background: rgba(142, 142, 147, 0.1);
    border-radius: 20px;
    color: var(--ios-gray-1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--ios-green);
    animation: none;
}

.status-dot.disconnected {
    background: var(--ios-red);
    animation: none;
}

.status-dot.status-pending {
    background: var(--ios-orange);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--ios-blue);
    cursor: pointer;
    padding: 8px;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.icon-btn svg {
    width: 22px;
    height: 22px;
    max-width: 100%;
    max-height: 100%;
}
#refreshBtn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: rgba(0, 122, 255, 0.1);
}

.icon-btn:active {
    background: rgba(0, 122, 255, 0.2);
    transform: scale(0.95);
}

/* PWA install button – suggests installing the app */
.install-pwa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
}
.install-pwa-btn:hover {
    background: rgba(0, 122, 255, 0.15);
    box-shadow: none;
}
.install-pwa-btn:active {
    transform: scale(0.98);
}
.install-pwa-btn {
    -webkit-tap-highlight-color: transparent;
}
.install-pwa-btn.hidden {
    display: none !important;
}
.install-pwa-icon {
    font-size: 16px;
}
.install-pwa-label {
    font-family: inherit;
}

/* Update available banner – iOS Style */
.update-available-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: rgba(0, 122, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #fff;
    padding: 12px 16px;
    padding-top: max(12px, var(--safe-top));
    padding-bottom: max(12px, var(--safe-bottom));
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: none;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.2);
}
.update-available-banner.hidden {
    display: none !important;
}
.update-available-banner #updateAvailableText {
    flex: 1;
    min-width: 200px;
    text-align: center;
    font-weight: 500;
}
.update-available-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.update-available-actions .btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.update-available-actions #updateRefreshBtn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.update-available-actions .install-pwa-btn-inline {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.update-available-actions .install-pwa-btn-inline:hover {
    background: rgba(255,255,255,0.3);
}

/* App screens – מבנה כאפליקציה רספונסיבית (תוכן בין header ל־nav, גלילה פנימית) */
.app-screens {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* Reserve space for fixed bottom nav so content is not hidden under it */
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}
.app-screen {
    display: none;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.25s ease;
    box-sizing: border-box;
}
.app-screen.active {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* All-in-one screen: single scrollable page (map + feed + shop) */
.app-screens.one-screen {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: block;
    flex: 1 1 0;
    min-height: 0;
}
.app-screens.one-screen .app-screen.one-screen-section {
    display: block;
    flex: none;
    min-height: 0;
    overflow: visible;
}
.app-screens.one-screen #screenMap {
    position: relative;
}
.app-screens.one-screen .map-container {
    height: 45vh;
    min-height: 220px;
    max-height: 400px;
    flex: none;
}
.app-screens.one-screen .feed-container,
.app-screens.one-screen .shop-container {
    flex: none;
    min-height: 0;
    overflow: visible;
    padding-bottom: 24px;
}
.app-screens.one-screen #screenFeed,
.app-screens.one-screen #screenShop {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 8px;
}

/* Bottom navigation – iOS Tab Bar Style */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    min-height: calc(83px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: none;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    z-index: 900;
    padding: 8px 0 calc(8px + var(--safe-bottom)) 0;
    padding-left: calc(0px + var(--safe-left));
    padding-right: calc(0px + var(--safe-right));
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    min-height: var(--touch-min);
    min-width: 0;
    border: none;
    background: none;
    color: var(--ios-gray-1);
    font-size: 10px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:hover {
    background: transparent;
}
.bottom-nav-item:active {
    transform: scale(0.95);
    opacity: 0.6;
}
.bottom-nav-item.active {
    color: var(--ios-blue);
    font-weight: 600;
    background: transparent;
}
.bottom-nav-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 2px;
}
.bottom-nav-label {
    line-height: 1.2;
    letter-spacing: 0.01em;
}

/* Feed screen – גלילה פנימית כמו באפליקציות */
.feed-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(24px + var(--safe-bottom));
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
    background: var(--surface);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.feed-header {
    margin-bottom: 20px;
}
.feed-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}
.feed-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}
.feed-section {
    margin-bottom: 24px;
}
.feed-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    padding: 0 4px;
}

.feed-section-meetings {
    margin-bottom: 28px;
}

.feed-section-meetings .feed-section-title {
    font-size: 1.0625rem;
    font-weight: 700;
}
.feed-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feed-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}
.feed-card:active {
    background: rgba(142, 142, 147, 0.1);
    transform: scale(0.98);
}
.feed-card:hover {
    background: rgba(142, 142, 147, 0.05);
}
.feed-card-avatar-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    position: relative;
}
.feed-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #eee;
}
.feed-card-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}
.feed-card-body {
    flex: 1;
    min-width: 0;
}
.feed-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}
.feed-card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}
.feed-activity-item {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.06);
}
.feed-activity-item:active {
    opacity: 0.95;
}
.feed-activity-num {
    font-weight: 700;
    color: var(--ios-blue);
    min-width: 1.5em;
    flex-shrink: 0;
}
.feed-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.feed-activity-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}
.feed-activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.feed-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Shop / Marketplace – גלילה פנימית כמו באפליקציות */
.shop-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(80px + var(--safe-bottom));
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.shop-header {
    margin-bottom: 16px;
}
.shop-header h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}
.shop-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.shop-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: rgba(142, 142, 147, 0.12);
    color: var(--ios-gray-1);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.shop-tab.active {
    background: var(--ios-blue);
    color: #fff;
}
.shop-tab:active {
    opacity: 0.7;
    transform: scale(0.98);
}
.shop-panel {
    display: none;
}
.shop-panel.active {
    display: block;
}
.shop-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.shop-search-bar input[type="search"] {
    flex: 1 1 180px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    max-width: 100%;
}
.shop-search-bar .btn { flex-shrink: 0; }
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.shop-filters label { margin-left: 4px; }
.shop-filters select,
.shop-filters input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
}
.shop-results,
.shop-my-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.shop-result-card,
.shop-my-product-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: none;
    cursor: pointer;
    border: none;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}
.shop-result-card:active,
.shop-my-product-card:active {
    background: rgba(142, 142, 147, 0.1);
    transform: scale(0.98);
}

.shop-result-card:hover,
.shop-my-product-card:hover {
    background: rgba(142, 142, 147, 0.05);
}
.shop-result-title,
.shop-my-product-card .shop-result-title {
    font-weight: 600;
    margin-bottom: 4px;
}
.shop-result-meta,
.shop-my-product-card .shop-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.shop-result-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.shop-empty-state {
    text-align: center;
    padding: 32px 16px;
}
.shop-empty-state p { margin-bottom: 16px; }

.shop-seller-state {
    padding: 20px 0;
}
.shop-seller-info, .shop-seller-pending-msg {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}
.shop-register-form {
    max-width: 320px;
}
.shop-tokens-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.shop-tokens-badge {
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
}

.shop-mystore-content .shop-mystore-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.shop-mystore-content .shop-mystore-header h3 {
    font-size: 1.2rem;
    flex: 1 1 100%;
}
.shop-my-product-card {
    position: relative;
}
.shop-delete-product {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 6px 12px;
}
.shop-loading,
.shop-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
}
.product-detail-meta,
.product-detail-desc,
.product-detail-seller {
    margin: 8px 0;
    color: var(--text-secondary);
}
.product-detail-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.product-detail-actions .btn {
    margin-bottom: 0;
}
.product-detail-btn-bitpay {
    background: #1a1f36 !important;
    color: #fff !important;
}
.product-buyer-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}
.product-buyer-form.hidden {
    display: none !important;
}
.product-detail-section-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}
.product-radius-warning {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 149, 0, 0.15);
    border-radius: 10px;
    font-size: 15px;
    color: #1a1a1a;
}
.product-radius-warning.hidden {
    display: none !important;
}

/* Help modal – הרשאת מיקום */
.help-intro {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.help-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}
.help-section:last-of-type {
    border-bottom: none;
}
.help-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}
.help-steps {
    margin: 0 0 12px 0;
    padding-right: 24px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
}
.help-steps li {
    margin-bottom: 8px;
}
.help-note {
    font-size: 15px;
    color: var(--ios-gray-1);
    margin: 8px 0 0 0;
    font-style: italic;
}
.help-footer {
    font-size: 14px;
    color: var(--ios-gray-1);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}
/* כניסה ראשונית – ידידותי במיוחד לאייפון */
.welcome-line {
    font-size: 1rem;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-weight: 600;
}
.modal-heading-friendly {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.modal-description-friendly {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 20px;
}
.legal-intro-friendly {
    margin-bottom: 16px;
}
.modal-content-onboarding {
    padding-top: max(24px, var(--safe-top));
    padding-bottom: max(28px, var(--safe-bottom));
    padding-left: max(24px, var(--safe-left));
    padding-right: max(24px, var(--safe-right));
}
.modal-onboarding .modal-content {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.onboarding-form .form-group {
    margin-bottom: 20px;
}
.btn-onboarding {
    min-height: 48px;
    font-size: 1.0625rem;
    font-weight: 600;
    padding: 14px 24px;
    margin-top: 8px;
    width: 100%;
    border-radius: var(--border-radius);
    -webkit-tap-highlight-color: transparent;
}
.legal-consent-checkbox-friendly {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
    margin: 16px 0;
}
.legal-consent-checkbox-friendly input {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 2px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.close-top-right {
    position: absolute;
    top: max(16px, var(--safe-top));
    left: 16px;
    right: auto;
    font-size: 1.75rem;
    line-height: 1;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* אייפון – מניעת זום בעת focus על input (16px מינימום) */
.input-ios-friendly {
    font-size: 16px !important;
    min-height: 48px;
    padding: 14px 16px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--border-radius-sm);
}

/* אייפון ומכשירי מגע – טאפ ללא הדגשה אפורה, שדות 16px נגד זום */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    a,
    .bottom-nav-item,
    .visibility-status,
    .feed-activity-item,
    .feed-card,
    .shop-tab,
    .shop-result-card,
    .shop-my-product-card {
        -webkit-tap-highlight-color: transparent;
    }
    .form-group input,
    .form-group select,
    .form-group textarea,
    input[type="search"],
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"] {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .modal-content-onboarding {
        padding-left: max(20px, var(--safe-left));
        padding-right: max(20px, var(--safe-right));
    }
    .modal-heading-friendly {
        font-size: 1.375rem;
    }
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Profile card actions - social style */
.profile-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-whatsapp {
    background: #25D366 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-whatsapp:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Map – ממלא את האזור בין header ל־nav (מבנה אפליקציה) */
#screenMap.app-screen.active {
    display: flex;
    flex-direction: column;
}
#screenMap .map-visibility-banner {
    flex-shrink: 0;
}
.map-wrapper {
    position: relative;
    flex: 1 1 0;
    min-height: 180px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.map-container {
    flex: 1 1 0;
    min-height: 180px;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}
.map-waiting-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(242, 242, 247, 0.95);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.map-waiting-overlay.hidden {
    display: none !important;
}
.map-waiting-content {
    text-align: center;
    max-width: 280px;
}
.map-waiting-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--ios-gray-4, #d1d1d6);
    border-top-color: var(--ios-blue, #007AFF);
    border-radius: 50%;
    animation: map-waiting-spin 0.9s linear infinite;
}
@keyframes map-waiting-spin {
    to { transform: rotate(360deg); }
}
.map-waiting-content p {
    margin: 12px 0 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary, #000);
}
.map-waiting-hint {
    font-size: 14px !important;
    color: var(--text-secondary, #666) !important;
    font-weight: 400 !important;
}
.product-radius-warning,
.product-detail-radius-warning {
    font-size: 13px;
    color: var(--ios-red, #c00);
    background: #fff0f0;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
}
.product-radius-warning.hidden,
.product-detail-radius-warning.hidden {
    display: none !important;
}
/* iPhone: explicit min-height so map gets space when flex is wrong */
@supports (padding: env(safe-area-inset-top)) {
    .map-wrapper,
    .map-container {
        min-height: calc(100vh - var(--header-h-actual) - var(--bottom-nav-h) - var(--safe-bottom) - 60px);
        min-height: calc(100dvh - var(--header-h-actual) - var(--bottom-nav-h) - var(--safe-bottom) - 60px);
    }
}
.map-container#map,
.map-container > div {
    width: 100% !important;
    height: 100% !important;
    min-height: inherit;
}

.map-visibility-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(255, 149, 0, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #fff;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.2);
}

.map-visibility-banner.hidden {
    display: none !important;
}

.map-visibility-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.map-visibility-banner-btn:active {
    opacity: 0.9;
}

/* Profile Card (אייפון – מעל home indicator) */
.profile-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: var(--safe-bottom);
    -webkit-transform: translateZ(0) translateY(100%);
    box-sizing: border-box;
}

.profile-card.show {
    transform: translateY(0);
    -webkit-transform: translateZ(0) translateY(0);
}

.profile-card.hidden {
    display: none !important;
}

.card-content {
    padding: 20px;
    padding-left: max(20px, var(--safe-left));
    padding-right: max(20px, var(--safe-right));
    padding-bottom: max(20px, calc(20px + var(--safe-bottom)));
    box-sizing: border-box;
    max-width: 100%;
}

.profile-photo {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(98, 0, 238, 0.3) !important;
}

.card-content h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.profile-title {
    color: var(--ios-blue);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 8px;
}

.profile-distance {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-mood {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue);
    margin: 8px 0;
}

.profile-bio {
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Buttons – iOS Style */
.btn {
    padding: 14px 24px;
    min-height: var(--touch-min);
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--ios-blue);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    background: var(--ios-blue-dark);
    opacity: 0.8;
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(142, 142, 147, 0.12);
    color: var(--ios-blue);
    border: none;
}

.btn-secondary:active {
    background: rgba(142, 142, 147, 0.2);
    opacity: 0.8;
    transform: scale(0.98);
}

/* Modal – iOS Style Bottom Sheet */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    box-sizing: border-box;
}

.modal.show {
    display: block !important;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    margin: auto;
    margin-top: auto;
    margin-bottom: 0;
    padding: 20px;
    border-radius: 14px 14px 0 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    position: relative;
    animation: slideUpFromBottom 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 600px) {
    .modal-content {
        max-width: 500px;
        width: 90%;
        margin: 20px auto;
        border-radius: 14px;
    }
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.close:active {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-content-scroll {
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.disclaimer-text {
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.65;
}

.disclaimer-text p {
    margin-bottom: 12px;
}

/* אישור חוקי – תנאי שימוש ומדיניות פרטיות */
.legal-consent-modal .legal-intro {
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}
.legal-consent-modal .legal-section {
    margin-bottom: 20px;
}
.legal-consent-modal .legal-section h3 {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--ios-blue);
    font-weight: 600;
}
.legal-consent-modal .legal-section ul {
    margin: 0 0 8px 1.2em;
    padding: 0;
}
.legal-consent-modal .legal-section li {
    margin-bottom: 6px;
}
.legal-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
}
.legal-consent-checkbox input {
    margin-top: 3px;
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
}
.legal-consent-checkbox input:not(:checked) + span {
    color: var(--text-secondary);
}

/* הגדרות שיתוף – רצון להיפגש */
.settings-willing-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 122, 255, 0.08);
    border-radius: 10px;
    border: none;
}

.settings-section-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.switch-willing .switch-label {
    font-weight: 600;
}

.modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-family: inherit;
    background: rgba(142, 142, 147, 0.12);
    transition: background 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: rgba(142, 142, 147, 0.18);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--ios-gray-1);
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
}

/* Settings */
.settings-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.settings-list {
    margin-bottom: 24px;
}

.switch {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
}

.switch input {
    display: none;
}

.slider {
    position: relative;
    width: 51px;
    height: 31px;
    background: rgba(142, 142, 147, 0.3);
    border-radius: 31px;
    transition: background 0.3s;
    margin-left: 12px;
    flex-shrink: 0;
}

.slider:before {
    content: "";
    position: absolute;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: white;
    top: 2px;
    right: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
    background: var(--ios-green);
}

.switch input:checked + .slider:before {
    transform: translateX(-20px);
}

.switch-label {
    font-size: 1rem;
    user-select: none;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    color: white;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Leaflet Customization */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.leaflet-popup-content {
    margin: 16px;
}

/* Map markers - profile photos / avatars */
.map-marker-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.map-marker-avatar:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.map-marker-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.map-marker-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.map-marker-user {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFEB3B;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.map-marker-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.map-marker-user-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFEB3B 0%, #FBC02D 100%);
    color: #333;
    font-size: 20px;
    font-weight: 700;
}
.leaflet-marker-icon.map-marker-icon {
    background: transparent !important;
    border: none !important;
}

/* Responsive – מובייל ראשון, טאבלט ודסקטופ */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.125rem;
    }
    
    .header .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .connection-status {
        font-size: 0.75rem;
    }
    
    .visibility-status span:not(.visibility-dot) {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .modal-content {
        margin: 10px auto;
        padding: 20px;
        width: 95%;
        max-width: calc(100vw - 20px);
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
    }
    
    .profile-card {
        max-height: 80vh;
        max-height: 80dvh;
    }
    
    .feed-container,
    .shop-container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .bottom-nav-label {
        font-size: 0.65rem;
    }
    
    .bottom-nav-item {
        padding: 8px 4px;
    }
}

/* מסכים קטנים מאוד (אייפון מיני וכו') */
@media (max-width: 360px) {
    body {
        font-size: 15px;
    }
    
    .header h1 {
        font-size: 1rem;
    }
    
    .header .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .header-actions .install-pwa-btn .install-pwa-label {
        display: none;
    }
    
    .connection-status #statusText {
        display: none;
    }
    
    .icon-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }
    
    .icon-btn svg, #refreshBtn svg {
        width: 20px;
        height: 20px;
    }
    
    .feed-container,
    .shop-container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .modal-content {
        width: 98%;
        margin: 8px auto;
        padding: 16px;
    }
    
    .bottom-nav-item {
        min-width: 0;
    }
    
    .shop-tabs {
        flex-direction: column;
    }
    
    .shop-tab {
        width: 100%;
    }
}

/* סופר רספונסיבי – כל אלמנט לא יברח מהמסך */
.app-screen,
.app-screens,
main {
    max-width: 100%;
    overflow-x: hidden;
}
input, select, textarea, button, .btn {
    max-width: 100%;
}

/* ========== אייפון – רספונסיביות מלאה ========== */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, var(--safe-left));
        padding-right: max(12px, var(--safe-right));
    }
}

@media (max-width: 430px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .header .container {
        padding-left: max(12px, var(--safe-left));
        padding-right: max(12px, var(--safe-right));
    }
    
    .header h1 {
        max-width: 40%;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .visibility-status {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    
    .connection-status {
        font-size: 0.75rem;
    }
    
    .app-screens {
        padding-bottom: calc(64px + var(--safe-bottom) + 20px);
    }
    
    .bottom-nav {
        padding-left: max(6px, var(--safe-left));
        padding-right: max(6px, var(--safe-right));
    }
    
    .bottom-nav-item {
        padding: 8px 4px;
        font-size: 0.7rem;
    }
    
    .bottom-nav-icon {
        font-size: 1.35rem;
    }
    
    .feed-container,
    .shop-container {
        padding-left: max(12px, var(--safe-left));
        padding-right: max(12px, var(--safe-right));
    }
    
    .map-container {
        min-height: 140px;
    }
    
    .modal {
        padding-left: var(--safe-left);
        padding-right: var(--safe-right);
    }
    
    .modal-content {
        width: calc(100% - 24px);
        max-width: calc(100vw - 24px);
        margin-left: auto;
        margin-right: auto;
    }
}

/* אייפון במצב standalone (PWA) – מניעת גלילה אופקית */
@supports (padding: env(safe-area-inset-top)) {
    .bottom-nav {
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

/* ---------- iPhone / iOS Safari – responsive fixes ---------- */
/* Explicit height so flex layout is stable (iOS flex bugs) */
@supports (padding: env(safe-area-inset-top)) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    .app-screens {
        min-height: 0;
        /* Explicit max-height so iOS Safari flex layout is stable */
        max-height: calc(100vh - var(--header-h-actual) - var(--bottom-nav-h) - var(--safe-bottom));
        max-height: calc(100dvh - var(--header-h-actual) - var(--bottom-nav-h) - var(--safe-bottom));
    }
}
/* Remove 300ms tap delay and improve touch on mobile (iPhone included) */
@media (hover: none) and (pointer: coarse) {
    a,
    button,
    .bottom-nav-item,
    .icon-btn,
    .btn,
    .shop-tab,
    .feed-card,
    .contact-item,
    [role="button"] {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    input,
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (min-width: 600px) {
    .feed-cards,
    .shop-grid {
        max-width: 520px;
        margin: 0 auto;
    }
}

@media (min-width: 768px) {
    .map-container {
        height: calc(100vh - var(--header-h-actual));
        height: calc(100dvh - var(--header-h-actual));
    }
    
    .profile-card {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: var(--border-radius);
    }
    
    .profile-card.show {
        transform: translateX(-50%) translateY(0);
        bottom: 20px;
    }
    
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
}

/* PWA Install Prompt (אייפון – מעל home indicator) */
.install-prompt {
    position: fixed;
    bottom: max(20px, var(--safe-bottom));
    left: max(20px, var(--safe-left));
    right: max(20px, var(--safe-right));
    background: var(--primary-color);
    color: white;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.install-prompt button {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

/* In-app push toast - התראה בזמן אמת */
.push-toast {
    position: fixed;
    top: max(70px, calc(44px + var(--safe-top) + 8px));
    left: max(12px, var(--safe-left));
    right: max(12px, var(--safe-right));
    z-index: 9999;
    max-width: 100vw;
    box-sizing: border-box;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pushToastIn 0.3s ease-out;
    border: 1px solid rgba(98, 0, 238, 0.2);
}
.push-toast.hidden {
    display: none !important;
}
.push-toast.show {
    display: flex !important;
}
.push-toast-content {
    flex: 1;
    min-width: 0;
}
.push-toast-title {
    font-weight: 600;
    color: #212121;
    display: block;
    font-size: 0.9375rem;
}
.push-toast-body {
    font-size: 0.8125rem;
    color: #666;
    display: block;
    margin-top: 2px;
}
.push-toast-btn {
    background: var(--ios-blue);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.push-toast-btn:active {
    opacity: 0.9;
}
@keyframes pushToastIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Conversations Modal - Contacts list style */
.conversations-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.conversations-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: var(--text-primary);
    padding: 16px 20px;
    padding-top: max(16px, var(--safe-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.conversations-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.conversations-header .close {
    color: var(--ios-blue);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    position: static;
    transition: opacity 0.2s;
}

.conversations-header .close:hover {
    opacity: 0.8;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    padding: 8px 0;
}

/* Contact Item Style - Like contacts list */
.contact-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    background: white;
    margin: 0;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: none;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    gap: 16px;
}

.contact-item:hover {
    background: rgba(142, 142, 147, 0.05);
}

.contact-item:active {
    background: rgba(142, 142, 147, 0.1);
}

.contact-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.contact-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contact-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 600;
    border: 3px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contact-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-name-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #212121;
    line-height: 1.4;
}

.contact-title {
    font-size: 15px;
    color: var(--ios-blue);
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 4px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #666;
}

.contact-detail-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.contact-detail-text {
    color: #424242;
    word-break: break-all;
}

.contact-meeting-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.8125rem;
    color: #757575;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.contact-meeting-text {
    color: #666;
}

.contact-distance {
    color: var(--ios-blue);
    font-weight: 500;
}

.contact-first-met {
    font-size: 0.75rem;
    color: #9e9e9e;
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #667781;
}

.empty-state p {
    margin: 8px 0;
    font-size: 1rem;
}

.empty-hint {
    font-size: 0.875rem !important;
    color: #8696a0 !important;
}

/* Conversations Search */
.conversations-search-container {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e9edef;
    display: flex;
    gap: 8px;
    align-items: center;
}

.conversations-search {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    background: rgba(142, 142, 147, 0.12);
    outline: none;
    transition: all 0.2s;
    direction: rtl;
}

.conversations-search:focus {
    background: rgba(142, 142, 147, 0.18);
    box-shadow: none;
}

.conversations-filter-btn {
    background: rgba(142, 142, 147, 0.12);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ios-blue);
    transition: all 0.2s;
    flex-shrink: 0;
}

.conversations-filter-btn:hover {
    background: rgba(142, 142, 147, 0.18);
}

.conversations-filter-btn:active {
    background: rgba(142, 142, 147, 0.25);
    transform: scale(0.95);
}

.conversations-export-btn {
    background: rgba(142, 142, 147, 0.12);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ios-blue);
    transition: all 0.2s;
    flex-shrink: 0;
}

.conversations-export-btn:hover {
    background: rgba(142, 142, 147, 0.18);
}

.conversations-export-btn:active {
    background: rgba(142, 142, 147, 0.25);
    transform: scale(0.95);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #667781;
}

.spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(142, 142, 147, 0.2);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.loading-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* Responsive for contacts */
@media (max-width: 480px) {
    .contact-item {
        padding: 12px 16px;
        margin: 0 4px 6px 4px;
        gap: 12px;
    }
    
    .contact-avatar,
    .contact-avatar-placeholder {
        width: 56px;
        height: 56px;
    }
    
    .contact-avatar-placeholder {
        font-size: 24px;
    }
    
    .contact-name {
        font-size: 1rem;
    }
    
    .contact-title {
        font-size: 0.875rem;
    }
    
    .conversations-search-container {
        padding: 10px 12px;
    }
    
    .conversations-search {
        font-size: 0.875rem;
        padding: 8px 12px;
    }
    
    .conversations-filter-btn,
    .conversations-export-btn {
        width: 36px;
        height: 36px;
    }
    
    .contact-details {
        gap: 4px;
    }
    
    .contact-meeting-info {
        font-size: 0.75rem;
    }
}

/* Accessibility improvements */
.contact-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.conversations-search:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Better image loading */
.contact-avatar {
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.contact-avatar[loading="lazy"] {
    opacity: 0.7;
}

.contact-avatar[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

.contact-item:hover .contact-avatar {
    transform: scale(1.05);
}

.pin-error {
    color: var(--error);
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}
.pin-error.hidden {
    display: none;
}

