
/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #fff; border-top: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: space-around; padding: 8px 0; padding-bottom: max(env(safe-area-inset-bottom), 8px); z-index: 100; }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; cursor: pointer; color: #aaa; padding: 4px 0; -webkit-appearance: none; }
.nav-btn.active { color: #00274C; }
.nav-btn span { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.nav-btn-camera { flex: 1; }
.nav-camera-btn { width: 48px; height: 48px; background: #FFCB05; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: -22px; }

/* Adjust screen padding for bottom nav */
.screen-home { padding-bottom: 80px; }
.screen-listings { padding-bottom: 80px; }


/* BOTTOM SHEET */
.sheet-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; }
.sheet-overlay.open { display: block; }


.bottom-sheet { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%); width: 100%; max-width: 430px; background: #f5f5f0; border-radius: 20px 20px 0 0; z-index: 201; transition: transform 0.3s ease; max-height: 90vh; display: flex; flex-direction: column; }
.bottom-sheet.open { transform: translateX(-50%) translateY(0); }
.sheet-inner { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px; padding-bottom: max(env(safe-area-inset-bottom), 24px); display: flex; flex-direction: column; gap: 12px; }


.sheet-handle { height: 20px; flex-shrink: 0; }
.sheet-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: #00274C; letter-spacing: 1px; margin-bottom: 4px; }
.sheet-sub { font-size: 13px; color: #888; line-height: 1.5; margin-bottom: 16px; }


/* HIDDEN INPUTS & TOGGLE */
.hidden-input { display: none; }
.mode-title { font-size: 14px; font-weight: 600; color: #00274C; }
.mode-desc { font-size: 12px; color: #888; margin-top: 2px; }
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle-lbl { font-size: 12px; }
.toggle { width: 44px; height: 24px; background: #ddd; border-radius: 12px; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.toggle.on { background: #00274C; }
.toggle-knob { width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left 0.2s; }
.toggle.on .toggle-knob { left: 23px; }
.btn-delete { width: 100%; background: #fff; border: 1.5px solid #e55; border-radius: 12px; padding: 13px; font-family: 'Bebas Neue', sans-serif; font-size: 18px; color: #e55; cursor: pointer; margin-top: 8px; display: block; -webkit-appearance: none; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #00274C; }
.app { font-family: 'DM Sans', sans-serif; background: #f5f5f0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; max-width: 430px; margin: 0 auto; overflow: hidden; }

/* TOP BAR */
.top-bar { background: #00274C; padding: 20px 20px 0; padding-top: max(env(safe-area-inset-top), 20px); flex-shrink: 0; }
.top-bar-row { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: 'Bebas Neue', sans-serif; font-size: 32px; color: #FFCB05; letter-spacing: 2px; line-height: 1; }
.tagline { font-size: 11px; color: #FFCB05; opacity: 0.7; letter-spacing: 0.5px; }
.tabs { display: flex; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 12px; }
.tab { flex: 1; padding: 10px; text-align: center; font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: 1px; color: rgba(255,203,5,0.5); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab.active { color: #FFCB05; border-bottom: 2px solid #FFCB05; }

/* SCREENS */
.screen { flex: 1; display: none; flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.screen.active { display: flex; }

/* HOME */
.screen-home { padding: 0; }
.home-hero { background: #00274C; padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.hero-text { font-family: 'Bebas Neue', sans-serif; font-size: 38px; color: #FFCB05; line-height: 1.05; letter-spacing: 1px; }
.hero-sub { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.5; }
.home-actions { display: flex; gap: 10px; padding: 16px 20px 0; }
.btn-list { flex: 1; background: #FFCB05; border: none; border-radius: 14px; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; -webkit-appearance: none; }
.btn-browse { flex: 1; background: #fff; border: 1.5px solid #e0e0e0; border-radius: 14px; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; -webkit-appearance: none; }
.btn-action-icon { width: 40px; height: 40px; background: #00274C; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.btn-action-icon-light { background: #f0f0f0; }
.btn-action-label { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: #00274C; letter-spacing: 1px; }
.btn-action-sub { font-size: 11px; color: #00274C; opacity: 0.6; text-align: center; }

/* BROWSE FEED */
.screen-browse { padding: 0 0 100px; }
.browse-header { padding: 16px 20px 8px; font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #00274C; }
.browse-feed { display: flex; flex-direction: column; gap: 12px; padding: 8px 20px 80px; }
.browse-card { background: #fff; border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.browse-card-img { width: 100%; height: 200px; object-fit: cover; display: block; background: #e8e8e0; }
.browse-card-placeholder { width: 100%; height: 200px; background: #e8e8e0; display: flex; align-items: center; justify-content: center; }
.browse-card-body { padding: 12px 16px 14px; }
.browse-card-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #00274C; line-height: 1.15; margin-bottom: 4px; }
.browse-card-meta { font-size: 12px; color: #aaa; margin-bottom: 8px; }
.browse-card-bottom { display: flex; align-items: center; justify-content: space-between; }
.browse-card-price { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #00274C; }
.browse-card-city { font-size: 12px; color: #888; background: #f0f0ea; padding: 3px 8px; border-radius: 8px; }

/* MY LISTINGS */
.screen-listings { padding: 20px 20px 100px; gap: 16px; }
.listings-header { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #00274C; }
.listings-empty { text-align: center; padding: 60px 20px; }
.listings-empty-icon { width: 64px; height: 64px; background: #e8e8e0; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.listings-empty-text { font-size: 16px; color: #888; line-height: 1.5; }
.listing-card { background: #fff; border-radius: 14px; overflow: hidden; display: flex; cursor: pointer; }
.listing-card-img { width: 90px; height: 90px; object-fit: cover; flex-shrink: 0; }
.listing-card-placeholder { width: 90px; height: 90px; background: #e8e8e0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.listing-card-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.listing-card-title { font-size: 13px; font-weight: 600; color: #00274C; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card-meta { font-size: 11px; color: #aaa; }
.listing-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.listing-card-price { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: #00274C; }
.status-pill { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.status-live { background: #dcfce7; color: #15803d; }
.status-sold { background: #fef9c3; color: #854d0e; }
.interest-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #fde8e8; color: #c0392b; }

/* BUYER VIEW */

.buyer-badge { display: inline-flex; align-items: center; gap: 6px; background: #FFCB05; color: #00274C; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; width: fit-content; }
.buyer-title { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #00274C; line-height: 1.15; }
.buyer-desc { font-size: 14px; color: #555; line-height: 1.6; background: #fff; border-radius: 12px; padding: 14px; }
.buyer-price-box { background: #00274C; border-radius: 12px; padding: 16px 20px; }
.buyer-price-label { font-size: 12px; color: #FFCB05; opacity: 0.8; }
.buyer-price-amount { font-family: 'Bebas Neue', sans-serif; font-size: 40px; color: #FFCB05; }
.buyer-condition { font-size: 12px; color: #FFCB05; opacity: 0.6; margin-top: 2px; }

.buyer-footer { font-size: 12px; color: #aaa; text-align: center; }

/* INTEREST FORM */
.interest-form { background: #fff; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.interest-form-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: #00274C; }
.interest-form-sub { font-size: 13px; color: #888; line-height: 1.5; margin-top: -8px; }
.venmo-note { background: #fffbe6; border: 1.5px solid #FFCB05; border-radius: 10px; padding: 12px; font-size: 13px; color: #00274C; line-height: 1.5; }


.screen-buyer { padding-bottom: 0; position: relative; }
.buyer-img { width: 100%; height: 280px; object-fit: cover; display: block; background: #e8e8e0; flex-shrink: 0; }
.buyer-scroll { flex: 1; overflow-y: auto; padding: 20px 20px 140px; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }

/* ANALYZING */
.screen-analyzing { align-items: center; justify-content: center; padding: 32px 20px; gap: 24px; }
.preview-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; }
.analyzing-box { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; text-align: center; }
.spinner { width: 48px; height: 48px; border: 3px solid #FFCB05; border-top-color: #00274C; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: #00274C; letter-spacing: 1px; }
.analyzing-sub { font-size: 13px; color: #888; line-height: 1.5; }

/* LISTING EDITOR */
.screen-listing { padding-bottom: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.listing-img-wrap { position: relative; flex-shrink: 0; overflow: hidden; }
.listing-img { width: 100%; height: auto; max-height: 50vh; object-fit: cover; display: block; background: #e8e8e0; }
.retake-btn { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.55); border: none; border-radius: 20px; padding: 6px 12px; color: #fff; font-size: 12px; font-family: 'DM Sans', sans-serif; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.listing-scroll { flex-shrink: 0; padding: 20px 20px 160px; display: flex; flex-direction: column; gap: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: #FFCB05; color: #00274C; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; width: fit-content; }
.listing-title-input { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: #00274C; line-height: 1.2; background: transparent; border: none; border-bottom: 2px dashed #e0e0e0; width: 100%; outline: none; padding: 4px 0; word-break: break-word; }
.listing-title-input:focus { border-bottom: 2px dashed #FFCB05; }
.grab-banner { background: #fffbe6; border: 1.5px solid #FFCB05; border-radius: 12px; padding: 14px; font-size: 13px; color: #00274C; line-height: 1.5; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; font-weight: 600; color: #aaa; letter-spacing: 0.8px; text-transform: uppercase; }
.field-input { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: 'DM Sans', sans-serif; color: #00274C; width: 100%; resize: none; -webkit-appearance: none; }
.field-input:focus { outline: 2px solid #FFCB05; border-color: transparent; }
.field-input:disabled { background: #f9f9f9; color: #555; }
.price-row { background: #00274C; border-radius: 12px; padding: 16px 20px; }
.price-label { font-size: 12px; color: #FFCB05; opacity: 0.8; margin-bottom: 4px; }
.price-input-wrap { display: flex; align-items: baseline; gap: 2px; }
.price-dollar { font-family: 'Bebas Neue', sans-serif; font-size: 36px; color: #FFCB05; }
.price-input { font-family: 'Bebas Neue', sans-serif; font-size: 36px; color: #FFCB05; background: transparent; border: none; outline: none; width: 120px; }
.paid-wrap { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.paid-label { font-size: 12px; color: #FFCB05; opacity: 0.6; white-space: nowrap; }
.paid-input { font-size: 14px; color: #FFCB05; background: transparent; border: none; border-bottom: 1px solid rgba(255,203,5,0.3); outline: none; width: 80px; font-family: 'DM Sans', sans-serif; padding: 2px 0; }
.paid-hint { font-size: 11px; color: #FFCB05; opacity: 0.4; margin-top: 6px; }
.reasoning-box { background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 12px; color: #888; line-height: 1.5; border-left: 3px solid #FFCB05; }
.action-row { display: flex; gap: 10px; }
.action-btn { flex: 1; background: #fff; border: 1.5px solid #00274C; border-radius: 12px; padding: 13px; font-family: 'Bebas Neue', sans-serif; font-size: 15px; color: #00274C; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; -webkit-appearance: none; }

/* PICKUP WINDOWS (seller sets availability) */
.windows-screen { padding: 20px 20px 140px; display: flex; flex-direction: column; gap: 16px; }
.windows-header { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: #00274C; line-height: 1.2; }
.windows-sub { font-size: 14px; color: #666; line-height: 1.5; }
.window-input-group { display: flex; flex-direction: column; gap: 8px; }
.window-input-label { font-size: 11px; font-weight: 600; color: #aaa; letter-spacing: 0.8px; text-transform: uppercase; }
.window-input { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: 'DM Sans', sans-serif; color: #00274C; width: 100%; -webkit-appearance: none; }
.window-input:focus { outline: 2px solid #FFCB05; border-color: transparent; }
.buyer-info-box { background: #00274C; border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.buyer-info-label { font-size: 11px; color: #FFCB05; opacity: 0.7; letter-spacing: 0.8px; text-transform: uppercase; }
.buyer-info-name { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: #FFCB05; }
.buyer-info-phone { font-size: 14px; color: #FFCB05; opacity: 0.8; }

/* PICKUP WINDOW PICKER (buyer picks a time) */
.window-option { background: #fff; border: 1.5px solid #e0e0e0; border-radius: 12px; padding: 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.window-option.selected { border-color: #00274C; background: #f0f4ff; }
.window-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ccc; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.window-option.selected .window-radio { border-color: #00274C; background: #00274C; }
.window-radio-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: none; }
.window-option.selected .window-radio-dot { display: block; }
.window-text { font-size: 15px; color: #00274C; font-weight: 500; }

/* INTEREST REQUESTS (seller inbox) */
.screen-requests { padding: 20px 20px 100px; gap: 16px; }
.requests-header { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: #00274C; }
.request-card { background: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.request-card-top { display: flex; align-items: center; justify-content: space-between; }
.request-item-title { font-size: 13px; font-weight: 600; color: #00274C; }
.request-buyer-name { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #00274C; }
.request-buyer-phone { font-size: 13px; color: #888; }
.request-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.request-status-pending { background: #fde8e8; color: #c0392b; }
.request-status-confirmed { background: #dcfce7; color: #15803d; }
.request-status-action { background: #fffbe6; color: #b8860b; }

/* BOTTOM BARS */
.bottom-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #f5f5f0; padding: 12px 20px; padding-bottom: max(env(safe-area-inset-bottom), 20px); border-top: 1px solid #e5e5e5; z-index: 10; }
.btn-primary { width: 100%; background: #FFCB05; color: #00274C; border: none; border-radius: 12px; padding: 16px; font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 1.5px; cursor: pointer; display: block; -webkit-appearance: none; }
.btn-primary:active { opacity: 0.85; }
.btn-secondary { width: 100%; background: transparent; color: #00274C; border: 1.5px solid #00274C; border-radius: 12px; padding: 13px; font-family: 'Bebas Neue', sans-serif; font-size: 18px; cursor: pointer; margin-top: 8px; display: block; -webkit-appearance: none; }

/* SUCCESS */
.screen-success { align-items: center; justify-content: center; padding: 40px 20px; gap: 20px; text-align: center; }
.success-circle { width: 80px; height: 80px; background: #FFCB05; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.success-title { font-family: 'Bebas Neue', sans-serif; font-size: 38px; color: #00274C; letter-spacing: 1px; line-height: 1.05; }
.success-sub { font-size: 15px; color: #555; line-height: 1.6; max-width: 280px; }
.success-card { background: #00274C; border-radius: 16px; padding: 20px; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.success-lbl { font-size: 11px; color: #FFCB05; opacity: 0.7; letter-spacing: 0.8px; text-transform: uppercase; }
.success-item-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #FFCB05; line-height: 1.2; }
.success-price { font-family: 'Bebas Neue', sans-serif; font-size: 40px; color: #FFCB05; }
.success-note { font-size: 12px; color: #FFCB05; opacity: 0.5; }
.share-big-btn { width: 100%; background: #fff; border: 1.5px solid #00274C; border-radius: 12px; padding: 15px; font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #00274C; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* LOADING */
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(0,39,76,0.75); z-index: 500; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.loading-overlay.open { display: flex; }
.loading-overlay .spinner { border-color: rgba(255,203,5,0.3); border-top-color: #FFCB05; }
.loading-overlay-text { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #FFCB05; letter-spacing: 1px; }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 1000; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { width: 100%; max-height: 100vh; object-fit: contain; }
.lightbox-close { position: absolute; top: max(env(safe-area-inset-top),16px); right: 16px; width: 36px; height: 36px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; }

/* NOT FOUND */
.screen-notfound { align-items: center; justify-content: center; padding: 40px 20px; gap: 16px; text-align: center; }
.notfound-title { font-family: 'Bebas Neue', sans-serif; font-size: 32px; color: #00274C; }
.notfound-sub { font-size: 15px; color: #888; line-height: 1.5; }
