/* =====================================================
   Cmmt∅ (Zero Commute) — stylesheet
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sand:           #f5f0eb;
    --sand-mid:       #ede5dc;
    --sand-dark:      #c9b8a8;
    --warm-white:     #faf8f5;
    --ink:            #3a3530;
    --ink-mid:        #7a706a;
    --ink-muted:      #9e9088;
    --ink-faint:      #b0a89e;
    --border:         #e0d8d0;
    --border-soft:    #ede5dc;
    --teal:           #78b8a8;
    --teal-light:     #d4ede8;

    /* kept as aliases so nothing breaks */
    --text-dark:      #3a3530;
    --text-mid:       #7a706a;
    --text-muted:     #9e9088;
    --text-faint:     #b0a89e;

    /* Avatar colour pairs */
    --av-sage-bg:        #d4e8d0; --av-sage-txt:        #3a6637;
    --av-blush-bg:       #f0dcd8; --av-blush-txt:       #7a3830;
    --av-sky-bg:         #d6e8f0; --av-sky-txt:         #2a5f78;
    --av-lavender-bg:    #e4daf0; --av-lavender-txt:    #5a3a78;
    --av-peach-bg:       #f0e4d0; --av-peach-txt:       #7a5030;
    --av-rose-bg:        #f5dde0; --av-rose-txt:        #7a3040;
}

html.dark {
    --sand:        #1e1b18;
    --sand-mid:    #2a2520;
    --sand-dark:   #4a4540;
    --warm-white:  #141210;
    --ink:         #e8e2da;
    --ink-mid:     #b0a89e;
    --ink-muted:   #807870;
    --ink-faint:   #605850;
    --border:      #3a3530;
    --border-soft: #2a2520;
    --teal:        #78b8a8;
    --teal-light:  #1a3530;
    --text-dark:   #e8e2da;
    --text-mid:    #b0a89e;
    --text-muted:  #807870;
    --text-faint:  #605850;
}

html, body {
    height: 100%;
    background: var(--sand);
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
}

/* ── ROOT LAYOUT ── */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── TOP BAR ── */
.topbar {
    padding: 6px 20px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--warm-white);
    border-bottom: 0.5px solid var(--border-soft);
    flex-shrink: 0;
    z-index: 10;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--ink);
    letter-spacing: -0.04em;
    line-height: 1;
}

.logo-name span { color: var(--sand-dark); }

.logo-sub {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    font-weight: 300;
    color: var(--ink-muted);
    letter-spacing: 0.06em;
    margin-top: 2px;
}


/* ── SEARCH + RADIUS ── */
.search-wrap {
    padding: 0;
    background: var(--warm-white);
    flex-shrink: 0;
    border-bottom: 0.5px solid var(--border);
}

.search-bar {
    background: var(--warm-white);
    border-radius: 0;
    border: none;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.search-bar input {
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--ink);
    width: 100%;
    outline: none;
}

.search-bar input::placeholder { color: var(--ink-muted); font-weight: 300; }


/* ── BODY WRAP (sidebar + map) ── */
.body-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── LEFT COLUMN (desktop only wrapper) ── */
/* On mobile: dissolve into flex items so search / map / sidebar order is preserved */
.left-col {
    display: contents;
}
.search-wrap { order: 1; }
#map         { order: 2; }
.sidebar     { order: 3; }

/* ── MAP ── */
#map {
    flex: 1;
    min-height: 0;
}

/* ── SIDEBAR (bottom sheet on mobile) ── */
.sidebar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--warm-white);
    border-radius: 20px 20px 0 0;
    border-top: 0.5px solid var(--border-soft);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}

/* ── MAP PANEL ── */
#map-panel {
    display: flex;
    flex-direction: column;
}

/* ── COMPANIES / POSITIONS / SAVED PANELS ── */
#companies-panel, #positions-panel, #saved-panel {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    background: var(--sand);
}

/* ── FEEDBACK TRIGGER BUTTON ── */
.feedback-trigger-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mid);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.feedback-trigger-btn:hover { background: var(--sand-mid); color: var(--teal); }

/* ── FEEDBACK MODAL ── */
.feedback-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.feedback-overlay.feedback-open { display: flex; }

.feedback-modal {
    background: var(--warm-white);
    border-radius: 18px;
    padding: 28px 26px 22px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    animation: modal-in 0.2s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.feedback-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}
.feedback-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.feedback-close:hover { background: var(--sand); color: var(--ink); }

.feedback-label {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}

.feedback-textarea-wrap {
    position: relative;
}
.feedback-textarea-wrap textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 12px 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--ink);
    background: var(--sand-light, var(--warm-white));
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.feedback-textarea-wrap textarea:focus { border-color: var(--teal); }
.feedback-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.72rem;
    color: var(--ink-faint);
    font-family: 'DM Mono', monospace;
    pointer-events: none;
}
.feedback-count.feedback-count-low { color: #c07040; }

.feedback-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.feedback-cancel {
    background: none;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem;
    color: var(--ink-mid);
    cursor: pointer;
    transition: background 0.15s;
}
.feedback-cancel:hover { background: var(--sand); }

.feedback-submit {
    background: var(--teal);
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}
.feedback-submit:hover   { opacity: 0.85; }
.feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-success {
    text-align: center;
    padding: 20px 0 10px;
}
.feedback-success-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--teal-light);
    color: var(--teal);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.feedback-success p {
    font-size: 0.9rem;
    color: var(--ink-mid);
}

/* ── THEME TOGGLE ── */
.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mid);
    flex-shrink: 0;
    transition: background 0.15s;
}
.theme-btn:hover { background: var(--sand-mid); }

/* ── NEAR ME ── */
.near-me-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 4px 10px 4px 12px;
    border-radius: 6px;
    border: none;
    border-left: 0.5px solid var(--border);
    background: transparent;
    color: var(--teal);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 4px;
}

/* ── SORT BUTTONS ── */
.sort-btns {
    display: flex;
    gap: 2px;
}
.sort-btn {
    font-size: 11px;
    font-family: 'DM Sans', sans-serif;
    padding: 3px 9px;
    border-radius: 6px;
    border: 0.5px solid var(--border);
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.12s;
}
.sort-btn:hover  { background: var(--sand); color: var(--ink); }
.sort-active     { background: var(--sand-mid) !important; color: var(--ink) !important; font-weight: 500; }

/* ── SHARE BUTTON ── */
.share-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ink-muted);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.share-btn:hover { color: var(--teal); }

/* ── TOAST ── */
#toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--ink);
    color: var(--warm-white);
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
    white-space: nowrap;
}
#toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* On mobile, when non-map tabs are active:
   hide the map and let the sidebar fill the screen */
@media (max-width: 767px) {
    .body-wrap.view-companies #map,
    .body-wrap.view-positions #map,
    .body-wrap.view-saved #map,
    .body-wrap.view-faq #map   { display: none; }
    .body-wrap.view-companies .sidebar,
    .body-wrap.view-positions .sidebar,
    .body-wrap.view-saved .sidebar,
    .body-wrap.view-faq .sidebar { flex: 1; min-height: 0; border-radius: 0; border-top: none; box-shadow: none; }
}

/* ── SAVE BUTTON ── */
.save-btn { color: var(--ink-faint); }
.save-btn.saved { color: var(--teal); }
.save-btn svg path { fill: none; }
.save-btn.saved svg path { fill: var(--teal); stroke: var(--teal); }


.jobs-view-header {
    padding: 14px 16px 10px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--ink-muted);
    letter-spacing: 0.04em;
    background: var(--warm-white);
    border-bottom: 0.5px solid var(--border-soft);
    flex-shrink: 0;
}

#companies-full-list, #positions-full-list, #jobs-full-list, #saved-full-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-content: start;
}

/* Cards inside the grid are cell-width, not fixed 168px */
#companies-full-list .card,
#positions-full-list .card,
#jobs-full-list .card,
#saved-full-list .card {
    width: 100%;
    min-width: unset;
}


/* ── LIST CARD (jobs view — wider horizontal layout) ── */
.list-card {
    background: var(--warm-white);
    border-radius: 14px;
    border: 0.5px solid var(--border-soft);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
    flex-shrink: 0;
}
.list-card:hover { border-color: var(--sand-dark); }

.lc-body {
    flex: 1;
    min-width: 0;
}

.lc-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lc-meta {
    font-size: 11px;
    color: var(--ink-muted);
    font-weight: 300;
    margin-top: 2px;
}

.lc-dist {
    font-family: 'DM Mono', monospace;
    color: var(--teal);
    font-weight: 400;
}

.lc-addr {
    font-size: 10px;
    color: var(--ink-faint);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lc-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}


.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--sand-mid);
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
}

/* ── FILTER CHIPS ── */
.filter-row {
    padding: 4px 16px 8px;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row:empty { display: none; padding: 0; }

.chip {
    font-size: 11px;
    font-family: 'DM Sans', sans-serif;
    padding: 5px 12px;
    border-radius: 20px;
    border: 0.5px solid var(--border);
    color: var(--ink-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}
.chip:hover:not(:disabled) { background: var(--sand); }
.chip.active {
    background: var(--sand-mid);
    border-color: var(--sand-dark);
    color: var(--ink);
    font-weight: 500;
}
.chip.chip-dim {
    opacity: 0.35;
    cursor: default;
}
.chip.chip-remote { border-style: dashed; }

/* ── COUNT LABEL ── */
.count-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.count-label:empty { display: none; }
.count-text {
    font-size: 11px;
    color: var(--ink-muted);
    flex: 1;
}

/* ── CARDS (horizontal scroll) ── */
.cards {
    display: flex;
    gap: 12px;
    padding: 4px 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.cards::-webkit-scrollbar { display: none; }

/* ── COMPANY CARD ── */
@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    min-width: 168px;
    width: 168px;
    background: var(--warm-white);
    border: 0.5px solid var(--border-soft);
    border-radius: 16px;
    padding: 14px;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: card-in 0.22s ease both;
}
.card:hover {
    border-color: var(--sand-dark);
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.card-highlight {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--teal-light);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.job-posted {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--ink-faint);
    font-weight: 300;
    align-self: center;
}

.card-more-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 0.5px solid var(--border-soft);
    flex-wrap: wrap;
}

.more-link {
    font-size: 10px;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
}
.more-link:hover {
    background: var(--sand);
    color: var(--ink);
}

.more-sep {
    font-size: 10px;
    color: var(--border-soft);
    user-select: none;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    overflow: hidden;
    margin-bottom: 10px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Avatar colour variants */
.av-sage     { background: var(--av-sage-bg);     color: var(--av-sage-txt); }
.av-blush    { background: var(--av-blush-bg);    color: var(--av-blush-txt); }
.av-sky      { background: var(--av-sky-bg);      color: var(--av-sky-txt); }
.av-lavender { background: var(--av-lavender-bg); color: var(--av-lavender-txt); }
.av-peach    { background: var(--av-peach-bg);    color: var(--av-peach-txt); }
.av-rose     { background: var(--av-rose-bg);     color: var(--av-rose-txt); }

.card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.card-type {
    font-size: 11px;
    color: var(--ink-muted);
    font-weight: 300;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-dist {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--teal);
    font-weight: 400;
    margin-bottom: 5px;
}

.card-addr {
    font-size: 10px;
    color: var(--ink-faint);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
}

.addr-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sand-dark);
    flex-shrink: 0;
    margin-top: 4px;
}

/* ── CARD ACTION BUTTONS ── */
.card-actions {
    display: flex;
    gap: 6px;
}

.btn {
    font-size: 11px;
    font-family: 'DM Sans', sans-serif;
    padding: 5px 11px;
    border-radius: 8px;
    border: 0.5px solid var(--border);
    color: var(--ink-mid);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-weight: 400;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    line-height: 1.6;
}
.btn:hover { background: var(--sand); }

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-li {
    border-color: #b8c8d8;
    color: #3a5068;
}

.btn-jobs {
    padding: 0 10px;
    height: 30px;
    font-size: 11px;
    font-weight: 500;
    color: #3a7868;
    border-color: var(--teal-light);
    background: var(--teal-light);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.btn-jobs:hover {
    background: #c0e0d8;
    border-color: var(--teal);
}



.btn.btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── SKELETON LOADING CARDS ── */
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    pointer-events: none;
    opacity: 0.85;
}

.skel {
    background: linear-gradient(90deg, var(--sand) 25%, var(--sand-mid) 50%, var(--sand) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
    margin-bottom: 9px;
}

.skel-avatar  { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 13px; }
.skel-title   { height: 12px; width: 65%; }
.skel-type    { height: 10px; width: 38%; }
.skel-addr    { height: 10px; width: 52%; }
.skel-actions { height: 28px; width: 45%; border-radius: 8px; margin-top: 4px; margin-bottom: 0; }

/* ── CAREERS BUTTON (briefcase icon, injected when a careers page is found) ── */
.careers-btn {
    color: var(--teal);
    border-color: var(--teal-light);
    background: var(--teal-light);
}
.careers-btn:hover {
    background: #c0e0d8;
    border-color: var(--teal);
}

/* ── STATUS MESSAGES (loading, no results, errors) ── */
.status-message {
    text-align: center;
    padding: 24px 16px;
    color: var(--ink-muted);
    min-width: 240px;
}
.status-message .status-icon { font-size: 1.8rem; margin-bottom: 8px; }
.status-message p { font-size: 0.85rem; line-height: 1.6; }
.status-message .status-hint { font-size: 0.8rem; color: var(--ink-faint); margin-top: 6px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px auto;
}

/* ── INSTRUCTIONS (initial state) ── */
#instructions {
    padding: 20px 12px;
    min-width: 260px;
    color: var(--ink-muted);
}
.instruction-icon { font-size: 1.8rem; margin-bottom: 10px; }
#instructions h2 {
    font-size: 0.9rem;
    color: var(--ink);
    margin-bottom: 10px;
    font-weight: 500;
}
#instructions ol {
    padding-left: 16px;
    font-size: 0.8rem;
    line-height: 1.9;
    color: var(--ink-muted);
    margin-bottom: 12px;
}
.tip {
    background: var(--sand);
    border-left: 2px solid var(--sand-dark);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--ink-mid);
    line-height: 1.5;
}

/* ── FAQ PANEL ── */
#faq-panel {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    background: var(--sand);
}

.faq-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-card {
    background: var(--warm-white);
    border: 0.5px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px 16px;
}

.faq-q {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 8px;
}

.faq-a {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-mid);
}

.faq-a ul {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.faq-a strong { color: var(--ink); font-weight: 500; }

/* ── BOTTOM NAV ── */
.bottom-nav {
    display: flex;
    border-top: 0.5px solid var(--border-soft);
    background: var(--warm-white);
    padding: 10px 0 max(16px, env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 0;
}

.nav-label {
    font-size: 10px;
    color: var(--ink-muted);
    font-weight: 300;
}

.nav-item.active .nav-label { color: var(--teal); }
.nav-item.active .nav-heart { color: var(--teal); fill: var(--teal); }

/* ── TOPBAR NAV (desktop only — hidden on mobile) ── */
.topbar-nav {
    display: none;
}

/* ================================================================
   DESKTOP LAYOUT  ≥ 768 px
   ================================================================ */
@media (min-width: 768px) {

    /* Topbar: logo on left, nav in centre, bell on right */
    .topbar {
        padding: 8px 24px;
        justify-content: space-between;
    }

    /* Show nav in topbar, hide bottom nav */
    .topbar-nav {
        display: flex;
        gap: 4px;
        order: 2;
    }
    .topbar .logo-wrap  { order: 1; }
    .topbar .theme-btn  { order: 3; }

    .topbar-nav .nav-item {
        flex-direction: row;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 10px;
        transition: background 0.15s;
    }
    .topbar-nav .nav-item:hover { background: var(--sand); }
    .topbar-nav .nav-item.active { background: var(--sand-mid); }
    .topbar-nav .nav-label { font-size: 12px; }

    .bottom-nav { display: none; }

    /* Body: left column | map side by side */
    .body-wrap { flex-direction: row; }

    /* Left column: search + sidebar stacked, fixed width */
    .left-col {
        display: flex;
        flex-direction: column;
        width: 360px;
        flex-shrink: 0;
        border-right: 0.5px solid var(--border-soft);
        background: var(--warm-white);
        min-height: 0;
        order: unset;
    }

    /* Reset order — not needed in desktop flex-row */
    .search-wrap { order: unset; flex-shrink: 0; padding: 10px 16px 10px; border-bottom: 0.5px solid var(--border-soft); }
    .search-bar  { background: var(--sand); border-radius: 12px; border: 0.5px solid var(--border); }
    #map         { order: unset; flex: 1; min-height: 0; }
    .sidebar     { order: unset; }

    /* Sidebar fills remaining height of left column */
    .sidebar {
        flex: 1;
        border-radius: 0;
        border-top: none;
        border-right: none;
        box-shadow: none;
        overflow: hidden;
        min-height: 0;
    }

    /* All panels fill the sidebar height */
    #map-panel,
    #companies-panel,
    #positions-panel,
    #saved-panel { flex: 1; min-height: 0; overflow: hidden; }

    /* Handle not needed on desktop */
    .sheet-handle { display: none; }

    /* Cards: vertical scroll instead of horizontal */
    .cards {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        flex: 1;
        padding: 8px 12px 16px;
    }

    .card {
        width: 100%;
        min-width: unset;
    }

    /* Non-map tabs: hide map, expand left column to full width */
    .body-wrap.view-companies #map,
    .body-wrap.view-positions #map,
    .body-wrap.view-saved #map,
    .body-wrap.view-faq #map    { display: none; }
    .body-wrap.view-companies .left-col,
    .body-wrap.view-positions .left-col,
    .body-wrap.view-saved .left-col,
    .body-wrap.view-faq .left-col { width: 100%; border-right: none; }
}
