/* ============================================================
   URLABURDA — Main stylesheet
   Urla identity: Aegean blue, olive green, sand beige, terracotta.
   Mobile-first responsive design.
   ============================================================ */

:root {
    /* Urla palette */
    --sea:         #16607a;   /* Aegean blue */
    --sea-dark:    #0d4356;
    --sea-light:   #e3f0f5;
    --olive:       #6f7d3f;   /* olive green */
    --olive-dark:  #55622e;
    --olive-light: #eef1e2;
    --terracotta:  #c96f4a;   /* brick/terracotta accent */
    --sand:        #faf6ee;   /* sand beige background */
    --sand-dark:   #f1e9da;
    --white:       #ffffff;
    --ink:         #22333b;   /* body text */
    --muted:       #6b7a83;
    --line:        #e5ddcd;
    --error:       #b3402e;
    --success:     #3f7d4e;
    --info:        #16607a;
    --shadow:      0 2px 12px rgba(13, 67, 86, .08);
    --radius:      14px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'Nunito Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(1200px 400px at 85% -50px, rgba(111,125,63,.10), transparent 60%),
        radial-gradient(900px 380px at 0% -80px, rgba(22,96,122,.10), transparent 55%),
        var(--sand);
    min-height: 100vh;
    padding-bottom: 70px; /* space for the mobile bottom bar */
}

a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); color: var(--sea-dark); line-height: 1.25; }
img { max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }

/* ---------- Common components ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 999px; border: none; cursor: pointer;
    font-weight: 700; font-size: 14px; text-decoration: none !important;
    transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--sea); color: var(--white); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--sea-dark); }
.btn-outline { background: transparent; color: var(--sea); border: 1.5px solid var(--sea); }
.btn-outline:hover { background: var(--sea-light); }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-logout { color: var(--terracotta); border-color: var(--terracotta); }
.btn-logout:hover { background: #fdf0e9; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }
.link-btn { background: none; border: none; color: var(--sea); cursor: pointer; padding: 0; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.verified { color: var(--sea); font-size: .85em; }
.role-badge {
    display: inline-block; font-family: var(--font-body); font-size: 11px; font-weight: 800;
    background: var(--olive-light); color: var(--olive-dark);
    padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--sea), var(--olive));
    color: var(--white); font-weight: 800; font-size: 15px; letter-spacing: .5px;
    user-select: none;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-lg { width: 84px; height: 84px; font-size: 26px; border: 4px solid var(--white); box-shadow: var(--shadow); }
.avatar-img { overflow: hidden; background: var(--sand-dark); }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Profile photo uploader: camera badge on the avatar (like the big platforms) */
.avatar-uploader { position: relative; display: inline-block; }
.avatar-cam {
    position: absolute; right: -3px; bottom: -3px;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--white); border: 1.5px solid var(--line);
    box-shadow: var(--shadow); cursor: pointer; font-size: 15px; padding: 0;
    transition: transform .1s ease, border-color .1s ease;
}
.avatar-cam:hover { transform: scale(1.1); border-color: var(--sea); }
.avatar-uploader.busy { opacity: .55; pointer-events: none; }
.avatar-uploader.busy .avatar-cam { animation: avatar-pulse 1s ease-in-out infinite; }
@keyframes avatar-pulse { 50% { transform: scale(.88); } }

/* Photo row in settings */
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-edit .avatar-lg { border-color: var(--sand); box-shadow: none; }
.avatar-edit-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.avatar-remove-btn { color: var(--terracotta); font-size: 13px; font-weight: 700; }

.alert {
    padding: 10px 14px; border-radius: var(--radius); margin: 0 0 14px;
    font-size: 14px; border: 1px solid transparent;
}
.alert-error   { background: #fbe9e5; color: var(--error); border-color: #eec5bc; }
.alert-success { background: #e8f3ea; color: var(--success); border-color: #c4ddc9; }
.alert-info    { background: var(--sea-light); color: var(--sea-dark); border-color: #c2dbe5; }

.empty-state {
    background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 28px 18px; text-align: center; color: var(--ink);
}
.section-title { font-size: 19px; margin: 22px 0 12px; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 700; }
.pagination { text-align: center; margin: 18px 0; }

.chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--white); border: 1px solid var(--line); border-radius: 999px;
    padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--ink);
    text-decoration: none !important; white-space: nowrap;
}
.chip:hover { border-color: var(--sea); color: var(--sea); }
.chip.active { background: var(--sea); border-color: var(--sea); color: var(--white); }

/* Feed selector: Urla + neighborhood feeds (horizontally scrollable) */
.feed-chips {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 2px 2px 10px; margin-bottom: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.feed-chips::-webkit-scrollbar { display: none; }
.feed-chips .chip { flex: 0 0 auto; padding: 6px 14px; }
.feed-chips .chip small { font-size: 11px; font-weight: 800; opacity: .6; }
.feed-chips .chip.mine:not(.active) { border-color: var(--sea); color: var(--sea-dark); font-weight: 800; }
.feed-context {
    background: var(--sea-light); color: var(--sea-dark);
    border-radius: var(--radius); padding: 10px 14px;
    font-size: 14px; margin-bottom: 12px;
}

.badge {
    background: var(--terracotta); color: var(--white); font-size: 10px; font-weight: 800;
    border-radius: 999px; padding: 1px 5px; vertical-align: top;
}

/* ---------- Top bar ---------- */

.top-bar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250, 246, 238, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.top-bar-inner {
    max-width: 1180px; margin: 0 auto; padding: 10px 14px;
    display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; text-decoration: none !important; }
/* Typographic wordmark — Helvetica-style, like the big social platforms */
.logo-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Nunito Sans', sans-serif;
    font-weight: 700; font-size: 23px; line-height: 1;
    color: var(--sea-dark); letter-spacing: -0.045em;
}
.top-search { flex: 1; max-width: 420px; margin-left: auto; }
.top-search input {
    width: 100%; padding: 9px 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--white); outline: none;
}
.top-search input:focus { border-color: var(--sea); }
.top-right { display: flex; align-items: center; gap: 10px; }
.top-icon { font-size: 20px; position: relative; text-decoration: none !important; }
.top-avatar { text-decoration: none !important; }

/* ---------- Main layout ---------- */

.container {
    max-width: 1180px; margin: 0 auto; padding: 16px 14px;
    display: grid; grid-template-columns: 1fr; gap: 20px;
}
.side-nav { display: none; }
.right-panel { display: none; }
.main { min-width: 0; }

/* Tablet and up: side nav visible */
@media (min-width: 760px) {
    body { padding-bottom: 0; }
    .bottom-bar { display: none !important; }
    .container { grid-template-columns: 200px minmax(0, 1fr); }
    .side-nav {
        display: flex; flex-direction: column; gap: 4px;
        position: sticky; top: 74px; align-self: start;
    }
}

/* Desktop: right panel visible too */
@media (min-width: 1060px) {
    .container { grid-template-columns: 210px minmax(0, 1fr) 310px; }
    .right-panel { display: block; position: sticky; top: 74px; align-self: start; }
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 999px;
    font-size: 16px; font-weight: 700; color: var(--ink);
    text-decoration: none !important;
}
.nav-item:hover { background: var(--sand-dark); }
.nav-item.active { background: var(--sea); color: var(--white); }
.nav-icon { font-size: 19px; width: 24px; text-align: center; }
.nav-badge { margin-left: auto; }
.nav-post-btn { margin-top: 10px; }
.nav-logout { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- Mobile bottom bar ---------- */

.bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    display: flex; justify-content: space-around; align-items: center;
    background: var(--white); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-bar a {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    font-size: 20px; color: var(--muted); text-decoration: none !important;
    min-width: 56px; position: relative;
}
.bottom-bar a small { font-size: 10px; font-weight: 700; }
.bottom-bar a:not(.bottom-post) > span { display: inline-flex; align-items: center; justify-content: center; height: 24px; }
.bottom-bar a.active .icn { stroke-width: 2.4; }
.bottom-bar a.active { color: var(--sea); }
.bottom-post span {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; margin-top: -20px; border-radius: 50%;
    background: var(--sea); color: var(--white);
    box-shadow: 0 4px 14px rgba(13, 67, 86, .35); font-size: 22px;
}
.bottom-dot {
    position: absolute; top: 0; right: 8px; width: 8px; height: 8px;
    background: var(--terracotta); border-radius: 50%;
}

/* ---------- Hero (guests) ---------- */

.hero {
    background: linear-gradient(140deg, var(--sea-dark), var(--sea) 55%, var(--olive));
    color: var(--white); border-radius: var(--radius);
    padding: 30px 24px; margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.hero h1 { color: var(--white); font-size: 27px; margin: 0 0 8px; }
.hero h1 em { font-style: normal; color: #ffd98e; }
.hero p { margin: 0 0 16px; opacity: .92; max-width: 540px; }
.hero .btn-primary { background: var(--white); color: var(--sea-dark); }

/* ---------- Compose box ---------- */

.compose-box {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
    box-shadow: var(--shadow);
}
/* Post detail: breathing room between the post and the reply box */
.feed + .compose-box { margin-top: 18px; }
.compose-top { display: flex; gap: 12px; }
.compose-box textarea {
    flex: 1; border: none; outline: none; resize: none;
    font-size: 17px; padding-top: 8px; background: transparent; min-height: 48px;
}
.compose-bottom {
    display: flex; align-items: center; justify-content: flex-end; gap: 14px;
    border-top: 1px solid var(--sand-dark); margin-top: 10px; padding-top: 10px;
}
.char-counter { font-size: 13px; font-weight: 700; color: var(--muted); }
.char-counter.low { color: var(--terracotta); }
.compose-bottom .char-counter { margin-left: auto; }
.compose-geo {
    display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
    background: none; border: 1.5px dashed var(--line); border-radius: 999px;
    padding: 5px 11px; font-size: 15px; font-weight: 700; color: var(--muted);
    line-height: 1; cursor: pointer; transition: border-color .12s ease, color .12s ease;
}
.compose-geo .photo-label, .compose-geo #geo-label { font-size: 12px; }
.compose-geo:hover { border-color: var(--sea); color: var(--sea); }
.compose-geo.on { background: var(--sea-light); border-style: solid; border-color: var(--sea); color: var(--sea-dark); }
.compose-geo:disabled { opacity: .6; cursor: wait; }

/* Selected photo thumbnails inside the compose box */
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-preview {
    position: relative; width: 76px; height: 76px; border-radius: 10px;
    overflow: hidden; border: 1px solid var(--line); flex: none;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview-del {
    position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
    border: none; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff;
    font-size: 11px; line-height: 20px; text-align: center; padding: 0; cursor: pointer;
}
.photo-preview-del:hover { background: rgba(0,0,0,.85); }

/* Photo grid on post cards (1-4 photos, Twitter style) */
.post-photos {
    display: grid; gap: 3px; margin-top: 10px;
    border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
}
.post-photos.count-2, .post-photos.count-3, .post-photos.count-4 { grid-template-columns: 1fr 1fr; }
.post-photo { display: block; cursor: zoom-in; background: var(--sand-dark); }
.post-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-photos.count-1 .post-photo img { height: auto; max-height: 460px; }
.post-photos.count-2 .post-photo,
.post-photos.count-4 .post-photo { height: 180px; }
.post-photos.count-3 .post-photo { height: 130px; }
.post-photos.count-3 .post-photo:first-child { grid-row: span 2; height: 263px; }

/* ---------- Admin panel ---------- */

.admin-head h1 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 24px; }
.admin-head { margin-bottom: 12px; }
.admin-head p { margin: 0; font-size: 14px; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.admin-tabs .chip { flex: 0 0 auto; }
.admin-search { margin-bottom: 12px; }
.admin-stats {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px;
}
@media (min-width: 640px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.admin-stat {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.admin-stat strong { display: block; font-size: 22px; color: var(--sea-dark); }
.admin-stat small { color: var(--muted); }
.admin-cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .admin-cols { grid-template-columns: 1fr 1fr; } }
.admin-row-line { margin: 0 0 8px; font-size: 14px; }
.admin-table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.admin-table th {
    text-align: left; padding: 10px 12px; background: var(--sea-light);
    color: var(--sea-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
}
.admin-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-row-off td { background: #faf6f0; color: var(--muted); }
.admin-actions { white-space: nowrap; }
.admin-inline { display: inline-block; margin: 0 4px 4px 0; }
.btn-danger { border: 1px solid #c0392b; color: #c0392b; background: var(--white); }
.btn-danger:hover { background: #c0392b; color: var(--white); }
.admin-pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Inline line icons (flat SVG) ---------- */

.icn { vertical-align: -0.18em; flex: 0 0 auto; }
.nav-icon { display: inline-flex; align-items: center; }
.top-icon { display: inline-flex; align-items: center; position: relative; }
.contact-list .icn { color: var(--sea); margin-right: 2px; }
.duty-icon { color: #c0392b; display: inline-flex; }
.like-btn .heart { display: inline-flex; }
.like-btn.liked { color: #e0245e; }
.like-btn.liked .heart svg { fill: #e0245e; stroke: #e0245e; }
.post-footer .action { display: inline-flex; align-items: center; gap: 5px; }
.chip .icn, .post-neigh .icn, .post-place .icn, .post-geo .icn,
.profile-neigh .icn, .place-card-neigh .icn { vertical-align: -0.15em; }

/* ---------- External ratings (Google) ---------- */

.grating {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 700; color: #444;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 2px 9px; white-space: nowrap;
}
.grating em {
    font-style: normal; font-weight: 800; font-size: 11px; line-height: 16px;
    width: 16px; height: 16px; text-align: center; border-radius: 50%;
    background: conic-gradient(#ea4335 0 25%, #fbbc05 25% 50%, #34a853 50% 75%, #4285f4 75% 100%);
    color: #fff;
}
.grating small { font-weight: 600; color: var(--muted); }
.grating-lg { font-size: 14px; padding: 4px 12px; }
.ext-ratings { margin-top: 4px; }

/* ---------- Duty pharmacy (nöbetçi eczane) ---------- */

.duty-card {
    background: #fff; border: 1px solid var(--line); border-left: 4px solid #c0392b;
    border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px;
}
.duty-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.duty-head h3 { margin: 0; font-size: 16px; }
.duty-item { border-top: 1px dashed var(--line); padding: 10px 0 4px; }
.duty-item strong { font-size: 15px; }
.duty-item p { margin: 4px 0; font-size: 13.5px; color: var(--ink); }
.duty-note { color: #a04000; font-weight: 600; }
.duty-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.btn-small { padding: 5px 12px; font-size: 13px; }

/* ---------- Tabs ---------- */

.tabs {
    display: flex; background: var(--white); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px; margin-bottom: 16px;
}
.tabs a {
    flex: 1; text-align: center; padding: 8px 10px; border-radius: 999px;
    font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none !important;
}
.tabs a.active { background: var(--sea); color: var(--white); }

/* ---------- Post card ---------- */

.feed { display: flex; flex-direction: column; gap: 10px; }
.post {
    display: flex; gap: 12px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px;
    box-shadow: var(--shadow);
}
.post-avatar { text-decoration: none !important; }
.post-body { flex: 1; min-width: 0; }
.post-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.post-author { display: flex; align-items: center; gap: 5px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.post-author strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-time { white-space: nowrap; }
.post-reply-info { font-size: 13px; color: var(--muted); margin-top: 2px; }
.post-content { margin-top: 4px; font-size: 15px; overflow-wrap: break-word; }
.post-content .hashtag, .post-content .mention { font-weight: 700; }
.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.post-place {
    display: inline-block; font-size: 13px; font-weight: 700;
    background: var(--olive-light); color: var(--olive-dark);
    padding: 3px 10px; border-radius: 999px; text-decoration: none !important;
}
.post-neigh {
    display: inline-block; font-size: 13px; font-weight: 700;
    background: var(--sea-light); color: var(--sea-dark);
    padding: 3px 10px; border-radius: 999px; text-decoration: none !important;
}
.post-neigh:hover { background: #d3e6ee; }
.post-geo {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 700; background: #fdf0e9; color: var(--terracotta);
    border: none; padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.post-geo:hover { background: #f9e2d5; }
.post-map {
    margin-top: 10px; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; background: var(--white);
}
.post-map iframe { display: block; width: 100%; height: 260px; border: 0; }
.post-map-link {
    display: block; text-align: right; font-size: 12px; font-weight: 700;
    padding: 6px 12px; border-top: 1px solid var(--sand-dark);
}
.post-footer { display: flex; gap: 26px; margin-top: 10px; }
.action {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 0;
    color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none !important;
}
.action:hover { color: var(--sea); }
.like-btn.liked .like-count { color: var(--terracotta); }

/* ---------- Auth / forms ---------- */

.auth-box {
    max-width: 440px; margin: 20px auto;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 18px; }
.auth-logo { display: block; margin-bottom: 10px; }
.auth-logo.logo-text { font-size: 34px; }
.auth-header h1 { font-size: 24px; margin: 0 0 6px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { font-weight: 700; font-size: 14px; margin-top: 8px; }
.auth-form input, .auth-form select, .auth-form textarea, .filter-strip input, .filter-strip select, .review-form textarea {
    padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
    background: var(--sand); outline: none; width: 100%;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus { border-color: var(--sea); background: var(--white); }
.auth-form .btn { margin-top: 12px; }
.pin-input { text-align: center; font-size: 26px !important; letter-spacing: 12px; font-weight: 800; }
.test-pin { font-size: 18px; letter-spacing: 3px; }
.auth-note { font-size: 13px; text-align: center; margin-top: 12px; }
.resend-form { text-align: center; margin-top: 14px; }

/* ---------- Explore / categories ---------- */

.explore-header h1 { font-size: 26px; margin: 4px 0 6px; }
.explore-header { margin-bottom: 16px; }
.category-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px;
}
@media (min-width: 560px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1060px) { .category-grid { grid-template-columns: repeat(4, 1fr); } }
.category-card {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    border-top: 4px solid var(--cat-color, var(--sea));
    padding: 18px 10px; text-align: center; text-decoration: none !important;
    color: var(--ink); box-shadow: var(--shadow);
    transition: transform .1s ease, box-shadow .15s ease;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13,67,86,.14); }
.category-icon { color: var(--cat-color, var(--sea)); display: inline-flex; margin-bottom: 2px; }

.category-header {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--white); border: 1px solid var(--line);
    border-left: 6px solid var(--cat-color, var(--sea));
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px;
}
.category-header-icon { color: var(--cat-color, var(--sea)); display: inline-flex; flex: 0 0 auto; opacity: .85; }
.category-header h1 { margin: 0; font-size: 23px; }
.category-header p { margin: 2px 0 0; font-size: 14px; }

.subcategory-strip, .filter-strip {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.filter-strip input[type="search"] { flex: 2; min-width: 140px; }
.filter-strip select { flex: 1; min-width: 120px; }
.filter-strip .btn { flex: 0 0 auto; }

/* ---------- Place cards ---------- */

.place-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .place-grid { grid-template-columns: repeat(2, 1fr); } }
.place-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none !important; color: var(--ink); box-shadow: var(--shadow);
    transition: transform .1s ease, box-shadow .15s ease;
}
.place-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13,67,86,.14); }
.place-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.place-card-icon { color: var(--muted); flex: 0 0 auto; margin-top: 2px; opacity: .7; }
.place-badge {
    display: inline-block; font-style: normal; margin: 2px 0 4px;
    background: var(--terracotta); color: var(--white);
    font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
}
.place-card-body { padding: 12px 14px 14px; }
.place-card h3 { margin: 0 0 4px; font-size: 17px; }
.place-card-neigh { display: inline-flex; align-items: center; gap: 3px; }
.place-card-summary {
    margin: 0 0 8px; font-size: 13px; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.place-card-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.rating { color: var(--terracotta); font-weight: 700; }
.rating b { color: var(--ink); }
.rating-lg { font-size: 16px; margin: 6px 0; }
.price { color: var(--olive-dark); font-weight: 800; letter-spacing: 1px; }

/* ---------- Place detail ---------- */

.place-detail {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--line);
    border-top: 5px solid var(--cat-color, var(--sea));
    border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.place-detail-media {
    display: flex; align-items: center; justify-content: center;
    width: 74px; height: 74px; flex: 0 0 auto; border-radius: var(--radius);
    background: var(--sea-light); color: var(--cat-color, var(--sea));
}
.place-detail-header h1 { margin: 0 0 6px; font-size: 24px; }
.place-detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.place-detail-summary { margin: 6px 0 0; }
.place-detail-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
@media (min-width: 700px) { .place-detail-grid { grid-template-columns: 3fr 2fr; } }

.feature-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contact-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours-table td { padding: 5px 4px; border-bottom: 1px solid var(--sand-dark); }
.hours-table tr.today td { font-weight: 800; color: var(--sea-dark); }
.hours-table .closed { color: var(--error); font-weight: 700; }

/* ---------- Reviews ---------- */

.review-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.review-form .btn { align-self: flex-end; }
.rating-select { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating-select input { display: none; }
.rating-select label { font-size: 28px; color: var(--line); cursor: pointer; transition: color .1s; }
.rating-select input:checked ~ label,
.rating-select label:hover, .rating-select label:hover ~ label { color: var(--terracotta); }

.review { border-top: 1px solid var(--sand-dark); padding: 12px 0 4px; }
.review header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.review header a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none !important; }
.review p { margin: 8px 0 4px; }

/* ---------- Profile ---------- */

.profile-header {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow);
}
.profile-cover {
    position: relative; height: 150px;
    background: linear-gradient(120deg, var(--sea-dark), var(--sea) 50%, var(--olive));
}
.profile-cover.has-photo {
    background-size: cover; background-position: center; cursor: zoom-in;
}
.profile-cover.busy { opacity: .55; pointer-events: none; }
.cover-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.cover-cam, .cover-del {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%; padding: 0;
    background: rgba(255, 255, 255, .92); border: 1.5px solid var(--line);
    box-shadow: var(--shadow); cursor: pointer; font-size: 15px;
    transition: transform .1s ease, border-color .1s ease;
}
.cover-cam:hover, .cover-del:hover { transform: scale(1.1); border-color: var(--sea); }
.cover-del { color: var(--terracotta); font-weight: 800; }

/* Avatar zoom trigger (someone else's profile) */
.avatar-zoom { cursor: zoom-in; display: inline-block; }
.avatar-uploader[data-lightbox] .avatar-img { cursor: zoom-in; }

/* Lightbox: large photo overlay (Twitter-style) */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 20, 26, .88); cursor: zoom-out;
    animation: lightbox-in .12s ease;
}
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
    max-width: min(92vw, 900px); max-height: 88vh;
    border-radius: 12px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, .14); color: var(--white);
    font-size: 17px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
.profile-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 0 18px; margin-top: -42px;
    /* The cover is position:relative; without this the overlapping avatar
       (e.g. the initials variant) would paint underneath it */
    position: relative; z-index: 1;
}
.profile-actions { margin-top: 52px; display: flex; gap: 8px; }
.profile-info { padding: 10px 18px 16px; }
.profile-info h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-bio { margin: 8px 0 0; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin: 8px 0 0; }
.profile-stats { display: flex; gap: 20px; margin: 10px 0 0; font-size: 14px; }

/* ---------- Notifications ---------- */

.notification-list { display: flex; flex-direction: column; gap: 8px; }
.notification {
    display: flex; flex-direction: column; gap: 3px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 14px;
    text-decoration: none !important; color: var(--ink);
}
.notification.unread { border-left: 4px solid var(--terracotta); background: #fffdf7; }
.notification-quote { font-size: 13px; color: var(--muted); font-style: italic; }
.notification-time { font-size: 12px; }

/* ---------- Right panel ---------- */

.panel-box {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.panel-box h3 { margin: 0 0 10px; font-size: 17px; }
.trend { display: flex; flex-direction: column; padding: 7px 0; text-decoration: none !important; border-bottom: 1px solid var(--sand-dark); }
.trend:last-child { border-bottom: none; }
.trend-tag { font-weight: 800; color: var(--sea-dark); }
.trend-count { font-size: 12px; color: var(--muted); }
.panel-place { display: flex; gap: 10px; align-items: center; padding: 7px 0; text-decoration: none !important; color: var(--ink); border-bottom: 1px solid var(--sand-dark); }
.panel-place:last-child { border-bottom: none; }
.panel-place-icon { color: var(--sea); display: inline-flex; }
.panel-place-info { display: flex; flex-direction: column; min-width: 0; }
.panel-place-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-place-info small { color: var(--terracotta); }
.panel-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--sand-dark); }
.panel-user:last-child { border-bottom: none; }
.panel-user-left { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--ink); min-width: 0; }
.panel-user-name { display: flex; flex-direction: column; min-width: 0; }
.panel-user-name strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-user-name small { color: var(--muted); }
.panel-footer { font-size: 12px; color: var(--muted); padding: 0 6px; }
.panel-footer p { margin-top: 6px; }
