/* City showcase SNS. Scoped to #newsPanel / .cs-* so nothing leaks into the game UI. */
:root { --city-showcase-gradient: linear-gradient(45deg, #ffb703 0%, #fb5607 35%, #ff006e 65%, #8338ec 100%); }
#topBar#topBar #btnCitySocial {
    background: var(--city-showcase-gradient);
    color: #fff;
    border-color: rgba(255, 0, 110, 0.35);
    box-shadow: 0 calc(3px * var(--ui-scale)) calc(10px * var(--ui-scale)) rgba(255, 0, 110, 0.25);
}
#newsPanel, .cs-vf, .cs-profile {
    /* The game shrinks --ui-scale to 0.6 on small screens; a photo feed needs readable text, so floor it. */
    --cs-s: max(0.9, var(--ui-scale, 1));
    --cs-fxs: max(11px, var(--font-xs, 11px)); --cs-fsm: max(13px, var(--font-sm, 13px)); --cs-fmd: max(14.5px, var(--font-md, 15px));
    --cs-flg: max(17px, var(--font-lg, 17px)); --cs-fxl: max(22px, var(--font-xl, 22px));
    --cs-bg: #f6f7f9; --cs-card: #ffffff; --cs-ink: #101828; --cs-muted: #667085; --cs-line: #e4e7ec;
    --cs-chip: #f1f3f6; --cs-chip-ink: #344054; --cs-heart: #ff3150; --cs-link: #2563eb;
    --cs-grad: var(--city-showcase-gradient);
    --cs-glass: rgba(255, 255, 255, 0.82);
    --cs-r: calc(16px * var(--cs-s));
}
body.dark-mode #newsPanel, body.dark-mode .cs-profile, html.lp-dark .cs-profile {
    --cs-bg: #0c1117; --cs-card: #141b24; --cs-ink: #e8edf3; --cs-muted: #93a1b3; --cs-line: #243042;
    --cs-chip: #1d2733; --cs-chip-ink: #d0d9e4; --cs-link: #7cb4ff; --cs-glass: rgba(20, 27, 36, 0.86);
}

/* ---------- Tabs (news ↔ showcase) ---------- */
#citySocialTabs {
    display: flex; align-items: center; gap: calc(4px * var(--cs-s)); flex-shrink: 0;
    padding: calc(6px * var(--cs-s)) calc(14px * var(--cs-s));
    background: var(--cs-card); border-bottom: 1px solid var(--cs-line);
}
#citySocialTabs button {
    display: inline-flex; align-items: center; gap: calc(6px * var(--cs-s));
    border: 0; border-radius: 999px; padding: calc(7px * var(--cs-s)) calc(14px * var(--cs-s));
    background: transparent; color: var(--cs-muted); font: inherit; font-size: var(--cs-fsm); font-weight: 700; cursor: pointer;
}
#citySocialTabs button:hover { background: var(--cs-chip); }
#citySocialTabs button[aria-selected="true"] { background: var(--cs-ink); color: var(--cs-card); }
#citySocialTab .cs-tab-dot { width: calc(6px * var(--cs-s)); height: calc(6px * var(--cs-s)); border-radius: 50%; background: #ff006e; }
#citySocialTab[aria-selected="true"] .cs-tab-dot { display: none; }

#newsPanel.city-social-active :is(.nh-site-header, .nh-page-area) { display: none !important; }

/* ---------- App shell ---------- */
#citySocialView {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
    scrollbar-gutter: stable;
    background: var(--cs-bg); color: var(--cs-ink); font-size: var(--cs-fmd); line-height: 1.45;
    font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}
#citySocialView[hidden], #citySocialView [hidden], .cs-vf [hidden] { display: none !important; }
#citySocialView :is(button, input, textarea, select) { font-family: inherit; }
#citySocialView a { color: inherit; text-decoration: none; }
#citySocialView :is(button, a, textarea, select, summary):focus-visible,
#citySocialTabs button:focus-visible, .cs-vf button:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
#citySocialView button:disabled { opacity: 0.45; cursor: not-allowed; }

.cs-appbar {
    position: sticky; top: 0; z-index: 6;
    display: flex; align-items: center; justify-content: space-between; gap: calc(10px * var(--cs-s));
    padding: calc(10px * var(--cs-s)) calc(20px * var(--cs-s));
    background: var(--cs-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--cs-line);
}
.cs-brand { display: flex; align-items: center; gap: calc(8px * var(--cs-s)); min-width: 0; }
.cs-brand-mark {
    display: grid; place-items: center; width: calc(32px * var(--cs-s)); height: calc(32px * var(--cs-s));
    border-radius: calc(10px * var(--cs-s)); background: var(--cs-grad); font-size: var(--cs-fmd);
    box-shadow: 0 3px 10px rgba(251, 86, 7, 0.3);
}
.cs-brand-name {
    font-size: var(--cs-flg); font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--cs-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cs-appbar-actions { display: flex; align-items: center; gap: calc(8px * var(--cs-s)); }
.cs-icon-btn {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: calc(36px * var(--cs-s)); height: calc(36px * var(--cs-s)); border-radius: 50%;
    border: 0; background: var(--cs-chip); color: var(--cs-ink); font-size: var(--cs-fmd); font-weight: 700; cursor: pointer;
}
.cs-icon-btn:hover { filter: brightness(0.95); }
.cs-shoot {
    display: inline-flex; align-items: center; gap: calc(7px * var(--cs-s));
    border: 0; border-radius: 999px; padding: calc(8px * var(--cs-s)) calc(16px * var(--cs-s)) calc(8px * var(--cs-s)) calc(12px * var(--cs-s));
    background: var(--cs-grad); color: #fff; font-size: var(--cs-fsm); font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 0, 110, 0.32); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cs-shoot:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 0, 110, 0.4); }
.cs-shoot:active { transform: scale(0.97); }
.cs-shoot.is-locked { filter: grayscale(0.6); opacity: 0.85; }
.cs-shoot-icon {
    width: calc(18px * var(--cs-s)); height: calc(18px * var(--cs-s)); background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 7.2 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9Zm3 4.5a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 7.2 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9Zm3 4.5a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Tag filter bar ---------- */
.cs-tagbar {
    position: sticky; top: calc(57px * var(--cs-s)); z-index: 5;
    display: flex; gap: calc(6px * var(--cs-s)); overflow-x: auto; scrollbar-width: none;
    padding: calc(9px * var(--cs-s)) calc(20px * var(--cs-s));
    background: var(--cs-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--cs-line);
}
.cs-tagbar::-webkit-scrollbar { display: none; }
.cs-chip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: calc(4px * var(--cs-s));
    border: 1px solid transparent; border-radius: 999px; padding: calc(6px * var(--cs-s)) calc(12px * var(--cs-s));
    background: var(--cs-chip); color: var(--cs-chip-ink); font-size: var(--cs-fsm); font-weight: 700; white-space: nowrap; cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.cs-chip:hover { border-color: var(--cs-line); }
.cs-chip:active { transform: scale(0.96); }
.cs-chip.is-active { background: var(--cs-ink); color: var(--cs-card); }
.cs-chip-sm { padding: calc(3px * var(--cs-s)) calc(9px * var(--cs-s)); font-size: var(--cs-fxs); }

/* ---------- Two-column layout: feed + TOP 3 rail ---------- */
.cs-shell {
    display: grid; grid-template-columns: minmax(0, 520px) calc(270px * var(--cs-s)); grid-template-areas: "feed aside";
    justify-content: center; align-items: start; gap: calc(28px * var(--cs-s));
    padding: calc(20px * var(--cs-s)) calc(20px * var(--cs-s)) calc(40px * var(--cs-s));
}
.cs-feed-col { grid-area: feed; min-width: 0; }
.cs-aside { grid-area: aside; position: sticky; top: calc(116px * var(--cs-s)); display: flex; flex-direction: column; gap: calc(12px * var(--cs-s)); }
.cs-top { background: var(--cs-card); border: 1px solid var(--cs-line); border-radius: var(--cs-r); padding: calc(14px * var(--cs-s)); }
.cs-top-title { display: flex; align-items: center; gap: calc(6px * var(--cs-s)); margin: 0 0 calc(10px * var(--cs-s)); font-size: var(--cs-fmd); font-weight: 800; }
.cs-top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(6px * var(--cs-s)); }
.cs-top-item {
    width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: calc(10px * var(--cs-s));
    border: 0; background: transparent; color: inherit; padding: calc(5px * var(--cs-s)); border-radius: calc(12px * var(--cs-s)); text-align: start; cursor: pointer;
}
.cs-top-item:hover { background: var(--cs-chip); }
.cs-top-thumb { position: relative; display: block; width: calc(72px * var(--cs-s)); aspect-ratio: 16 / 10; border-radius: calc(9px * var(--cs-s)); overflow: visible; background: #cfdcdf; }
.cs-top-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cs-top-medal { position: absolute; inset-inline-start: calc(-6px * var(--cs-s)); top: calc(-7px * var(--cs-s)); font-size: var(--cs-flg); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.cs-top-text { display: flex; flex-direction: column; min-width: 0; }
.cs-top-text b, .cs-top-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-top-text b { font-size: var(--cs-fsm); }
.cs-top-text small { color: var(--cs-muted); font-size: var(--cs-fxs); }
.cs-top-likes { display: inline-flex; align-items: center; gap: calc(3px * var(--cs-s)); color: var(--cs-heart); font-size: var(--cs-fxs); font-weight: 800; }
.cs-top-likes .cs-icon { width: calc(14px * var(--cs-s)); height: calc(14px * var(--cs-s)); }
.cs-top-likes svg { fill: currentColor; stroke: none; }
.cs-tag-note { display: flex; gap: calc(6px * var(--cs-s)); align-items: flex-start; margin: 0; color: var(--cs-muted); font-size: var(--cs-fxs); line-height: 1.5; }
.cs-aside-note { padding: 0 calc(6px * var(--cs-s)); }

/* ---------- Notices ---------- */
.cs-notice, .cs-login, .cs-newer {
    display: flex; align-items: center; justify-content: center; gap: calc(8px * var(--cs-s));
    margin: 0 0 calc(14px * var(--cs-s)); padding: calc(10px * var(--cs-s)) calc(14px * var(--cs-s));
    border-radius: 999px; font-size: var(--cs-fsm); font-weight: 700;
}
.cs-notice { background: #e8f7ee; color: #166534; }
.cs-notice.cs-error { background: #fdecec; color: #b42318; }
body.dark-mode #newsPanel .cs-notice { background: #133222; color: #a7f3c4; }
body.dark-mode #newsPanel .cs-notice.cs-error { background: #3d1717; color: #fecaca; }
.cs-login { background: var(--cs-chip); color: var(--cs-ink); }
.cs-newer {
    position: sticky; top: calc(124px * var(--cs-s)); z-index: 4; margin-inline: auto; width: max-content;
    border: 0; background: var(--cs-link); color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    animation: cs-drop 0.3s ease;
}
.cs-more {
    display: block; margin: calc(6px * var(--cs-s)) auto 0; border: 1px solid var(--cs-line); border-radius: 999px;
    padding: calc(9px * var(--cs-s)) calc(22px * var(--cs-s)); background: var(--cs-card); color: var(--cs-ink); font-weight: 700; font-size: var(--cs-fsm); cursor: pointer;
}
.cs-error { color: #d92d20; }
.cs-muted { color: var(--cs-muted); font-size: var(--cs-fsm); margin: calc(4px * var(--cs-s)) 0; }

/* ---------- Post card ---------- */
.cs-feed { display: flex; flex-direction: column; gap: calc(18px * var(--cs-s)); margin-bottom: calc(18px * var(--cs-s)); }
.cs-card { background: var(--cs-card); border: 1px solid var(--cs-line); border-radius: var(--cs-r); overflow: clip; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.cs-card.cs-just-posted { animation: cs-glow 2.4s ease; }
.cs-card-head { display: flex; align-items: center; gap: calc(8px * var(--cs-s)); padding: calc(10px * var(--cs-s)) calc(8px * var(--cs-s)) calc(10px * var(--cs-s)) calc(12px * var(--cs-s)); }
.cs-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: calc(10px * var(--cs-s)); }
.cs-who-text { display: flex; flex-direction: column; min-width: 0; }
.cs-name { font-weight: 800; font-size: var(--cs-fsm); }
a.cs-name:hover, .cs-who:hover .cs-name { text-decoration: underline; }
.cs-sub { display: flex; align-items: center; gap: calc(5px * var(--cs-s)); min-width: 0; color: var(--cs-muted); font-size: var(--cs-fxs); }
.cs-sub-city { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-time { color: var(--cs-muted); white-space: nowrap; font-size: var(--cs-fxs); }
.cs-avatar {
    --av-h: 200;
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: calc(34px * var(--cs-s)); height: calc(34px * var(--cs-s)); border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--av-h) 75% 62%), hsl(calc(var(--av-h) + 40) 70% 48%));
    color: #fff; font-weight: 900; font-size: var(--cs-fsm); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.cs-avatar-ring { box-shadow: 0 0 0 2px var(--cs-card), 0 0 0 4px hsl(var(--av-h) 85% 58%); margin: calc(3px * var(--cs-s)); }
.cs-avatar-sm { width: calc(28px * var(--cs-s)); height: calc(28px * var(--cs-s)); font-size: var(--cs-fxs); }
.cs-icon { display: inline-flex; flex-shrink: 0; width: calc(24px * var(--cs-s)); height: calc(24px * var(--cs-s)); }
.cs-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.cs-menu { position: relative; flex-shrink: 0; }
.cs-menu summary {
    list-style: none; display: grid; place-items: center; width: calc(34px * var(--cs-s)); height: calc(34px * var(--cs-s));
    border-radius: 50%; cursor: pointer; color: var(--cs-ink);
}
.cs-menu summary::-webkit-details-marker { display: none; }
.cs-menu summary:hover { background: var(--cs-chip); }
.cs-menu summary svg { width: calc(20px * var(--cs-s)); height: calc(20px * var(--cs-s)); fill: currentColor; }
.cs-menu-options {
    position: absolute; z-index: 7; inset-inline-end: 0; top: calc(100% + 4px);
    display: flex; flex-direction: column; min-width: max-content; padding: calc(6px * var(--cs-s));
    background: var(--cs-card); border: 1px solid var(--cs-line); border-radius: calc(12px * var(--cs-s)); box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    animation: cs-drop 0.15s ease;
}
.cs-menu-item {
    display: block; border: 0; background: none; color: var(--cs-ink); text-align: start; cursor: pointer;
    padding: calc(9px * var(--cs-s)) calc(12px * var(--cs-s)); border-radius: calc(8px * var(--cs-s)); font-size: var(--cs-fsm); font-weight: 600;
}
.cs-menu-item:hover { background: var(--cs-chip); }
.cs-menu-danger { color: #d92d20; }

.cs-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #c9dfe0, #9fbcb2); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cs-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-image-failed { display: grid; place-items: center; color: #fff; font-size: var(--cs-fsm); }
.cs-burst { position: absolute; left: 50%; top: 50%; width: 28%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none; animation: cs-burst 0.85s ease forwards; }
.cs-burst svg { width: 100%; height: 100%; fill: #fff; stroke: none; filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35)); }

.cs-actions { display: flex; align-items: center; gap: calc(2px * var(--cs-s)); padding: calc(6px * var(--cs-s)) calc(8px * var(--cs-s)) 0; }
.cs-act {
    display: inline-flex; align-items: center; gap: calc(5px * var(--cs-s)); border: 0; background: none; color: var(--cs-ink);
    padding: calc(7px * var(--cs-s)); border-radius: 999px; font-size: var(--cs-fsm); font-weight: 700; cursor: pointer;
}
.cs-act:hover { background: var(--cs-chip); }
.cs-act-count { min-width: 1ch; }
.cs-view-count { display: inline-flex; align-items: center; gap: calc(4px * var(--cs-s)); padding: calc(8px * var(--cs-s)); color: var(--cs-muted); font-size: var(--cs-fxs); white-space: nowrap; }
.cs-like.is-liked { color: var(--cs-heart); }
.cs-like.is-liked svg { fill: currentColor; }
.cs-like.cs-pop .cs-icon { animation: cs-pop 0.45s cubic-bezier(.17,.89,.32,1.49); }
.cs-visit { margin-inline-start: auto; color: var(--cs-link); }
.cs-visit .cs-icon { width: calc(20px * var(--cs-s)); height: calc(20px * var(--cs-s)); }

.cs-card-body { padding: calc(2px * var(--cs-s)) calc(15px * var(--cs-s)) calc(14px * var(--cs-s)); display: flex; flex-direction: column; align-items: flex-start; gap: calc(6px * var(--cs-s)); }
.cs-card-body > * { margin: 0; }
.cs-likes { font-weight: 800; font-size: var(--cs-fsm); }
.cs-caption { font-size: var(--cs-fsm); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; width: 100%; }
.cs-caption.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cs-card-tags { display: flex; flex-wrap: wrap; gap: calc(5px * var(--cs-s)); }
.cs-link { border: 0; background: none; padding: 0; color: var(--cs-muted); font-size: var(--cs-fsm); font-weight: 600; cursor: pointer; }
.cs-link:hover { color: var(--cs-ink); }
.cs-read-more { margin-top: calc(-4px * var(--cs-s)); }

/* ---------- Comments ---------- */
.cs-comments { width: 100%; display: flex; flex-direction: column; gap: calc(8px * var(--cs-s)); border-top: 1px solid var(--cs-line); padding-top: calc(10px * var(--cs-s)); margin-top: calc(4px * var(--cs-s)); }
.cs-comment-list { display: flex; flex-direction: column; gap: calc(10px * var(--cs-s)); max-height: calc(320px * var(--cs-s)); overflow-y: auto; }
.cs-comment { display: flex; gap: calc(9px * var(--cs-s)); align-items: flex-start; }
.cs-comment-avatar { flex-shrink: 0; }
.cs-comment-body { min-width: 0; flex: 1; }
.cs-comment-text { margin: 0; font-size: var(--cs-fsm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-comment-meta { display: flex; gap: calc(10px * var(--cs-s)); align-items: center; margin-top: calc(2px * var(--cs-s)); }
.cs-delete-comment { font-size: var(--cs-fxs); }
.cs-reactions { display: flex; gap: calc(2px * var(--cs-s)); overflow-x: auto; scrollbar-width: none; }
.cs-reactions::-webkit-scrollbar { display: none; }
.cs-reaction {
    flex-shrink: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
    width: calc(34px * var(--cs-s)); height: calc(34px * var(--cs-s)); font-size: var(--cs-flg); line-height: 1;
    transition: transform 0.12s ease;
}
.cs-reaction:hover { background: var(--cs-chip); transform: scale(1.18); }
.cs-comment-form { display: flex; align-items: center; gap: calc(9px * var(--cs-s)); border: 1px solid var(--cs-line); border-radius: 999px; padding: calc(5px * var(--cs-s)) calc(14px * var(--cs-s)) calc(5px * var(--cs-s)) calc(5px * var(--cs-s)); background: var(--cs-bg); }
.cs-comment-input {
    flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cs-ink); resize: none; outline: none;
    font-size: var(--cs-fsm); line-height: 1.45; padding: calc(4px * var(--cs-s)) 0; max-height: calc(120px * var(--cs-s));
}
#citySocialView .cs-comment-input:focus-visible { outline: none; }
.cs-comment-form:focus-within { border-color: var(--cs-link); }
.cs-send { color: var(--cs-link); font-weight: 800; }
.cs-send:disabled { opacity: 0.35; }

/* ---------- Empty / loading ---------- */
.cs-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(6px * var(--cs-s)); list-style: none;
    padding: calc(28px * var(--cs-s)) calc(16px * var(--cs-s)); text-align: center; color: var(--cs-muted);
    background: var(--cs-card); border: 1px dashed var(--cs-line); border-radius: var(--cs-r);
}
.cs-top .cs-empty { padding: calc(14px * var(--cs-s)); background: transparent; }
.cs-empty p { margin: 0; font-size: var(--cs-fsm); max-width: 30em; }
.cs-empty-symbol { font-size: calc(var(--cs-fxl) * 1.4); }
.cs-skeleton {
    list-style: none; border-radius: var(--cs-r); min-height: calc(320px * var(--cs-s));
    background: linear-gradient(90deg, var(--cs-chip) 0%, var(--cs-card) 50%, var(--cs-chip) 100%) 0 0 / 200% 100%;
    animation: cs-shimmer 1.2s linear infinite;
}
.cs-top-list .cs-skeleton { min-height: calc(48px * var(--cs-s)); border-radius: calc(10px * var(--cs-s)); }

/* ---------- Dialogs ---------- */
.cs-sheet, .cs-post-dialog, .cs-confirm {
    /* The game resets every margin to 0; restore the browser's centring for modal dialogs. */
    position: fixed; inset: 0; margin: auto; height: fit-content;
    border: 0; padding: 0; color: var(--cs-ink); background: var(--cs-card);
    border-radius: calc(20px * var(--cs-s)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}
.cs-sheet::backdrop, .cs-post-dialog::backdrop, .cs-confirm::backdrop { background: rgba(8, 12, 18, 0.62); backdrop-filter: blur(3px); }
.cs-sheet[open], .cs-post-dialog[open], .cs-confirm[open] { animation: cs-rise 0.22s ease; }
.cs-sheet { width: min(880px, 94vw); max-height: 92vh; overflow: hidden; }
.cs-sheet-body { display: flex; flex-direction: column; max-height: 92vh; }
.cs-sheet-head {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: calc(10px * var(--cs-s));
    padding: calc(10px * var(--cs-s)) calc(14px * var(--cs-s)); border-bottom: 1px solid var(--cs-line);
}
.cs-sheet-head h3 { margin: 0; text-align: center; font-size: var(--cs-fmd); font-weight: 800; }
.cs-share {
    border: 0; border-radius: 999px; padding: calc(8px * var(--cs-s)) calc(18px * var(--cs-s)); cursor: pointer;
    background: var(--cs-grad); color: #fff; font-weight: 800; font-size: var(--cs-fsm);
}
.cs-share:disabled { background: var(--cs-chip); color: var(--cs-muted); cursor: not-allowed; }
.cs-sheet-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); overflow-y: auto; }
.cs-sheet-media { padding: calc(16px * var(--cs-s)); display: flex; flex-direction: column; gap: calc(10px * var(--cs-s)); background: var(--cs-bg); }
.cs-sheet-fields { padding: calc(16px * var(--cs-s)); display: flex; flex-direction: column; gap: calc(8px * var(--cs-s)); border-inline-start: 1px solid var(--cs-line); }
.cs-develop { position: relative; aspect-ratio: 16 / 9; border-radius: calc(14px * var(--cs-s)); overflow: hidden; background: #1f2937; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.cs-develop img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter 1.4s ease, transform 1.4s ease; }
.cs-develop-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cs-fxl) * 2); opacity: 0.5; }
.cs-develop:not([data-state="empty"]) .cs-develop-empty { display: none; }
.cs-develop-badge {
    position: absolute; inset-inline-start: 50%; bottom: calc(12px * var(--cs-s)); translate: -50% 0;
    display: none; align-items: center; gap: calc(7px * var(--cs-s)); padding: calc(6px * var(--cs-s)) calc(12px * var(--cs-s));
    border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: var(--cs-fxs); font-weight: 700; white-space: nowrap;
}
[dir="rtl"] .cs-develop-badge { translate: 50% 0; }
.cs-develop[data-state="developing"] .cs-develop-badge { display: inline-flex; }
/* Instant-camera "developing" look while the server makes the real photo. */
.cs-develop[data-state="developing"] img { filter: sepia(0.55) saturate(0.6) brightness(1.15) blur(2px); transform: scale(1.02); animation: cs-develop 2.4s ease-in-out infinite; }
.cs-develop[data-state="failed"] img { filter: grayscale(1) brightness(0.7); }
.cs-spinner { width: calc(12px * var(--cs-s)); height: calc(12px * var(--cs-s)); border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: cs-spin 0.8s linear infinite; }
.cs-steps { display: flex; list-style: none; margin: 0; padding: 0; gap: calc(4px * var(--cs-s)); }
.cs-steps li {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: calc(3px * var(--cs-s));
    padding: calc(6px * var(--cs-s)) 0; border-radius: calc(10px * var(--cs-s)); background: var(--cs-card); border: 1px solid var(--cs-line);
    color: var(--cs-muted); font-size: var(--cs-fxs); opacity: 0.55; transition: opacity 0.2s ease, border-color 0.2s ease;
}
.cs-steps li span { font-size: var(--cs-fmd); }
.cs-steps li.is-done { opacity: 1; border-color: #22c55e; color: #16a34a; }
.cs-steps li.is-current { opacity: 1; border-color: var(--cs-link); color: var(--cs-link); animation: cs-pulse 1.2s ease-in-out infinite; }
.cs-status { margin: 0; min-height: 1.4em; color: var(--cs-muted); font-size: var(--cs-fsm); text-align: center; }
.cs-sheet-shots { display: flex; justify-content: center; gap: calc(8px * var(--cs-s)); }
.cs-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: calc(6px * var(--cs-s));
    border: 1px solid var(--cs-line); border-radius: 999px; padding: calc(8px * var(--cs-s)) calc(16px * var(--cs-s));
    background: var(--cs-card); color: var(--cs-ink); font-size: var(--cs-fsm); font-weight: 700; cursor: pointer;
}
.cs-pill:hover { background: var(--cs-chip); }
.cs-primary { background: var(--cs-ink); color: var(--cs-card); border-color: var(--cs-ink); }
.cs-danger { background: #d92d20; color: #fff; border-color: #d92d20; }
.cs-field-label { display: flex; align-items: center; gap: calc(6px * var(--cs-s)); font-size: var(--cs-fsm); font-weight: 800; margin-top: calc(4px * var(--cs-s)); }
.cs-counter { margin-inline-start: auto; color: var(--cs-muted); font-weight: 600; font-size: var(--cs-fxs); }
.cs-select, .cs-textarea {
    box-sizing: border-box; width: 100%; border: 1px solid var(--cs-line); border-radius: calc(12px * var(--cs-s));
    padding: calc(10px * var(--cs-s)) calc(12px * var(--cs-s)); background: var(--cs-bg); color: var(--cs-ink); font-size: var(--cs-fsm); line-height: 1.5;
}
.cs-textarea { resize: vertical; min-height: calc(96px * var(--cs-s)); }
.cs-tag-picker { display: flex; flex-wrap: wrap; gap: calc(6px * var(--cs-s)); }
.cs-tag-picker .cs-chip:disabled { opacity: 0.35; }

.cs-post-dialog { width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; background: transparent; box-shadow: none; overflow: visible; }
.cs-post-dialog .cs-card { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); max-height: 90vh; overflow-y: auto; }
.cs-dialog-close { position: absolute; inset-inline-end: calc(-46px * var(--cs-s)); top: 0; background: rgba(255,255,255,0.9); color: #111; }
.cs-confirm { padding: calc(22px * var(--cs-s)); width: min(380px, calc(100vw - 36px)); }
.cs-confirm h3 { margin: 0 0 calc(8px * var(--cs-s)); font-size: var(--cs-fmd); }
.cs-confirm p { margin: 0; color: var(--cs-muted); font-size: var(--cs-fsm); line-height: 1.55; }
.cs-confirm-actions { display: flex; justify-content: flex-end; gap: calc(8px * var(--cs-s)); margin-top: calc(18px * var(--cs-s)); }
/* Dialogs can sit in the top layer outside dark-mode inheritance. */
body.dark-mode .cs-confirm, body.dark-mode .cs-sheet { --cs-bg: #0c1117; --cs-card: #141b24; --cs-ink: #e8edf3; --cs-muted: #93a1b3; --cs-line: #243042; --cs-chip: #1d2733; --cs-chip-ink: #d0d9e4; --cs-link: #7cb4ff; }

/* ---------- Narrow: single column, TOP 3 becomes a story strip ---------- */
@media (max-width: 860px) {
    .cs-shell { grid-template-columns: minmax(0, 560px); grid-template-areas: "aside" "feed"; gap: calc(14px * var(--cs-s)); padding: calc(12px * var(--cs-s)) calc(12px * var(--cs-s)) calc(32px * var(--cs-s)); }
    .cs-aside { position: static; }
    .cs-aside-note { display: none; }
    .cs-top { padding: calc(10px * var(--cs-s)) calc(10px * var(--cs-s)) calc(6px * var(--cs-s)); }
    .cs-top-title { margin-bottom: calc(6px * var(--cs-s)); font-size: var(--cs-fsm); }
    .cs-top-list { flex-direction: row; gap: calc(12px * var(--cs-s)); overflow-x: auto; scrollbar-width: none; padding: calc(4px * var(--cs-s)) calc(2px * var(--cs-s)); }
    .cs-top-list::-webkit-scrollbar { display: none; }
    .cs-top-row { flex: 0 0 auto; }
    .cs-top-item { grid-template-columns: 1fr; justify-items: center; gap: calc(4px * var(--cs-s)); width: calc(84px * var(--cs-s)); padding: calc(4px * var(--cs-s)) 0; text-align: center; }
    .cs-top-thumb { width: calc(66px * var(--cs-s)); aspect-ratio: 1; border-radius: 50%; padding: 3px; background: var(--cs-grad); }
    .cs-top-row:nth-child(1) .cs-top-thumb { background: linear-gradient(135deg, #fde68a, #f59e0b); }
    .cs-top-row:nth-child(2) .cs-top-thumb { background: linear-gradient(135deg, #e5e7eb, #9ca3af); }
    .cs-top-row:nth-child(3) .cs-top-thumb { background: linear-gradient(135deg, #fed7aa, #c2410c); }
    .cs-top-thumb img { border-radius: 50%; border: 2px solid var(--cs-card); box-sizing: border-box; }
    .cs-top-medal { inset-inline-start: auto; inset-inline-end: calc(-4px * var(--cs-s)); top: auto; bottom: calc(-4px * var(--cs-s)); }
    .cs-top-text { align-items: center; width: 100%; }
    .cs-top-text small { display: none; }
    .cs-top-text b { max-width: 100%; font-size: var(--cs-fxs); }
    .cs-top .cs-empty { min-width: 100%; }
    .cs-sheet-grid { grid-template-columns: 1fr; }
    .cs-sheet-fields { border-inline-start: 0; border-top: 1px solid var(--cs-line); }
    .cs-dialog-close { inset-inline-end: calc(8px * var(--cs-s)); top: calc(8px * var(--cs-s)); z-index: 3; }
}
@media (max-width: 560px) {
    .cs-appbar { padding: calc(8px * var(--cs-s)) calc(12px * var(--cs-s)); }
    .cs-tagbar { padding-inline: calc(12px * var(--cs-s)); top: calc(53px * var(--cs-s)); }
    .cs-shoot-label { display: none; }
    .cs-shoot { padding: calc(9px * var(--cs-s)); }
    .cs-brand-mark { display: none; }
    .cs-shell { padding-inline: 0; }
    .cs-card, .cs-top { border-radius: 0; border-inline: 0; }
    .cs-sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .cs-sheet-body { max-height: 100dvh; height: 100%; }
    .cs-act-label { display: none; }
}

/* ---------- Camera HUD (viewfinder over the live city) ---------- */
/* A clean frame: top bar, tutorial bubbles and the dev panel come back when the camera closes. */
body.cs-vf-active :is(#topBar, #topBar *, .hud-photo-controls, .hud-photo-controls *, #mobileMenuBtn, #devPanel, #advisorStepOverlay) { visibility: hidden !important; transition: none !important; }
.cs-vf {
    position: fixed; inset: 0; z-index: 8800; pointer-events: none; color: #fff;
    font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    box-shadow: inset 0 0 calc(180px * var(--cs-s)) rgba(0, 0, 0, 0.5);
    opacity: 0; transition: opacity 0.2s ease;
}
.cs-vf.is-open { opacity: 1; }
.cs-vf-grid {
    position: absolute; inset: 0; opacity: 0.55; transition: opacity 0.2s ease;
    background:
        linear-gradient(to right, transparent calc(33.333% - 0.5px), rgba(255,255,255,0.5) calc(33.333% - 0.5px), rgba(255,255,255,0.5) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255,255,255,0.5) calc(66.666% - 0.5px), rgba(255,255,255,0.5) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
        linear-gradient(to bottom, transparent calc(33.333% - 0.5px), rgba(255,255,255,0.5) calc(33.333% - 0.5px), rgba(255,255,255,0.5) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255,255,255,0.5) calc(66.666% - 0.5px), rgba(255,255,255,0.5) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
}
.cs-vf.cs-vf-nogrid .cs-vf-grid { opacity: 0; }
.cs-vf-corner { position: absolute; width: calc(54px * var(--cs-s)); height: calc(54px * var(--cs-s)); border: 0 solid #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,0.5)); transition: transform 0.35s cubic-bezier(.2,.9,.3,1.2); }
.cs-vf-tl { left: 4vmin; top: 4vmin; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 10px; transform: translate(-14px, -14px); }
.cs-vf-tr { right: 4vmin; top: 4vmin; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 10px; transform: translate(14px, -14px); }
.cs-vf-bl { left: 4vmin; bottom: 4vmin; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 10px; transform: translate(-14px, 14px); }
.cs-vf-br { right: 4vmin; bottom: 4vmin; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 10px; transform: translate(14px, 14px); }
.cs-vf.is-open .cs-vf-corner { transform: none; }
.cs-vf-focus {
    position: absolute; left: 50%; top: 50%; width: calc(86px * var(--cs-s)); height: calc(86px * var(--cs-s)); translate: -50% -50%;
    border: 1.5px solid rgba(255,255,255,0.85); border-radius: 8px; box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.cs-vf-focus::before, .cs-vf-focus::after { content: ''; position: absolute; left: 50%; top: 50%; background: rgba(255,255,255,0.9); translate: -50% -50%; }
.cs-vf-focus::before { width: 14px; height: 1.5px; }
.cs-vf-focus::after { width: 1.5px; height: 14px; }
.cs-vf-top {
    position: absolute; left: 50%; top: calc(18px * var(--cs-s)); translate: -50% 0; pointer-events: auto;
    display: flex; align-items: center; gap: calc(8px * var(--cs-s)); max-width: 80vw;
    padding: calc(8px * var(--cs-s)) calc(16px * var(--cs-s)); border-radius: 999px; background: rgba(10, 14, 20, 0.62); backdrop-filter: blur(8px);
    font-size: var(--cs-fsm); white-space: nowrap;
}
.cs-vf-rec { width: calc(9px * var(--cs-s)); height: calc(9px * var(--cs-s)); border-radius: 50%; background: #ff3150; box-shadow: 0 0 8px #ff3150; animation: cs-blink 1.1s steps(2, start) infinite; }
.cs-vf-city { color: rgba(255,255,255,0.75); overflow: hidden; text-overflow: ellipsis; }
.cs-vf-hint { position: absolute; left: 50%; top: calc(64px * var(--cs-s)); translate: -50% 0; margin: 0; font-size: var(--cs-fxs); text-shadow: 0 1px 3px rgba(0,0,0,0.8); white-space: nowrap; opacity: 0.9; }
.cs-vf-warn { position: absolute; left: 50%; top: 58%; translate: -50% 0; margin: 0; max-width: 80vw; text-align: center; padding: calc(9px * var(--cs-s)) calc(16px * var(--cs-s)); border-radius: 999px; background: rgba(217, 45, 32, 0.9); font-size: var(--cs-fsm); font-weight: 700; }
.cs-vf-bar {
    position: absolute; left: 50%; bottom: calc(30px * var(--cs-s)); translate: -50% 0; pointer-events: auto;
    display: flex; align-items: center; gap: calc(34px * var(--cs-s));
    padding: calc(10px * var(--cs-s)) calc(22px * var(--cs-s)); border-radius: 999px; background: rgba(10, 14, 20, 0.42); backdrop-filter: blur(8px);
}
.cs-vf-side {
    display: grid; place-items: center; width: calc(48px * var(--cs-s)); height: calc(48px * var(--cs-s)); border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.12); color: #fff; font-size: var(--cs-flg); font-weight: 800; cursor: pointer;
}
.cs-vf-side:hover { background: rgba(255,255,255,0.25); }
.cs-vf-side.is-on { background: rgba(255,255,255,0.9); color: #111; }
.cs-vf-shutter {
    display: grid; place-items: center; width: calc(78px * var(--cs-s)); height: calc(78px * var(--cs-s)); border-radius: 50%;
    border: 4px solid #fff; background: transparent; padding: 0; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 6px 20px rgba(0,0,0,0.35);
}
.cs-vf-shutter-core { display: block; width: calc(62px * var(--cs-s)); height: calc(62px * var(--cs-s)); border-radius: 50%; background: #fff; transition: transform 0.12s ease, background 0.12s ease; }
.cs-vf-shutter:hover .cs-vf-shutter-core { transform: scale(0.94); }
.cs-vf-shutter:active .cs-vf-shutter-core, .cs-vf-snap .cs-vf-shutter-core { transform: scale(0.8); background: #e5e7eb; }
.cs-vf-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.cs-vf-blades { position: absolute; inset: 0; pointer-events: none; }
.cs-vf-blades::before, .cs-vf-blades::after { content: ''; position: absolute; left: 0; right: 0; height: 0; background: #000; }
.cs-vf-blades::before { top: 0; }
.cs-vf-blades::after { bottom: 0; }
.cs-vf-snap .cs-vf-blades::before, .cs-vf-snap .cs-vf-blades::after { animation: cs-blade 0.26s ease-in-out; }
.cs-vf-snap .cs-vf-flash { animation: cs-flash 0.5s ease-out 0.12s; }
.cs-vf-snap .cs-vf-corner { transform: scale(0.9); }
.cs-vf-snap :is(.cs-vf-hint, .cs-vf-grid, .cs-vf-focus) { opacity: 0; }
.cs-vf-polaroid {
    position: absolute; left: 50%; top: 50%; width: min(46vw, calc(420px * var(--cs-s))); translate: -50% -50%;
    padding: calc(10px * var(--cs-s)) calc(10px * var(--cs-s)) calc(36px * var(--cs-s)); background: #fff; border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55); animation: cs-print 0.95s cubic-bezier(.3,.8,.3,1) forwards;
}
.cs-vf-polaroid img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; }
.cs-vf-shake .cs-vf-bar { animation: cs-shake 0.4s ease; }

/* ---------- Motion ---------- */
@keyframes cs-burst { 0% { opacity: 0; scale: 0.3; } 18% { opacity: 1; scale: 1.15; } 32% { scale: 0.95; } 45% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1.1; translate: -50% -70%; } }
@keyframes cs-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes cs-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes cs-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cs-glow { 0%, 60% { box-shadow: 0 0 0 3px #ff006e66, 0 10px 30px rgba(255, 0, 110, 0.2); } 100% { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); } }
@keyframes cs-shimmer { to { background-position: -200% 0; } }
@keyframes cs-spin { to { transform: rotate(360deg); } }
@keyframes cs-pulse { 50% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); } }
@keyframes cs-develop { 50% { filter: sepia(0.35) saturate(0.8) brightness(1.08) blur(1px); } }
@keyframes cs-blink { to { visibility: hidden; } }
@keyframes cs-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
@keyframes cs-blade { 0% { height: 0; } 50% { height: 50.5%; } 100% { height: 0; } }
@keyframes cs-print { 0% { opacity: 0; scale: 1.25; rotate: 0deg; } 30% { opacity: 1; scale: 1; rotate: -3deg; } 72% { opacity: 1; scale: 1; rotate: -3deg; translate: -50% -50%; } 100% { opacity: 0; scale: 0.45; rotate: 4deg; translate: -50% -110%; } }
@keyframes cs-shake { 0%, 100% { translate: -50% 0; } 25% { translate: calc(-50% - 10px) 0; } 50% { translate: calc(-50% + 10px) 0; } 75% { translate: calc(-50% - 6px) 0; } }
@media (prefers-reduced-motion: reduce) {
    #citySocialView *, .cs-vf, .cs-vf * , .cs-sheet, .cs-post-dialog { animation: none !important; transition: none !important; }
    .cs-vf-polaroid { opacity: 1; }
}

/* ---------- Entry points: 📸 buttons, badge, ticker, first-time tip ---------- */
.cs-badge {
    position: absolute; top: -6px; right: -6px; z-index: 2; pointer-events: none;
    min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ff3150; color: #fff; border: 2px solid #fff;
    font: 800 10px/1 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0;
    box-shadow: 0 2px 6px rgba(255, 49, 80, 0.45);
}
.cs-badge[hidden] { display: none !important; }
.cs-badge.is-new { background: linear-gradient(45deg, #fb5607, #ff006e 60%, #8338ec); font-size: 9px; animation: cs-badge-pulse 1.8s ease-in-out infinite; }
#btnSocialFloat {
    position: fixed; top: calc(var(--bar-height, 56px) + 194px); left: 12px; z-index: 1100;
    width: 56px; height: 56px; padding: 6px 4px; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 2px solid #fff; border-radius: 14px; cursor: pointer; user-select: none; color: #fff;
    background: linear-gradient(45deg, #ffb703 0%, #fb5607 35%, #ff006e 65%, #8338ec 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#btnSocialFloat:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 6px 16px rgba(255, 0, 110, 0.45); }
#btnSocialFloat:active { transform: scale(0.97); }
#btnSocialFloat .social-float-icon { font-size: 22px; line-height: 1; }
#btnSocialFloat .social-float-label { font: 800 8px/1 system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap; max-width: 52px; overflow: hidden; text-overflow: ellipsis; }
.showcase-mode #btnSocialFloat, body.hide-ui #btnSocialFloat, body.cs-vf-active #btnSocialFloat { display: none !important; }
@media (max-width: 768px) {
    #btnSocialFloat { top: calc(var(--bar-height, 52px) + 150px); left: 6px; width: 48px; height: 48px; }
    #btnSocialFloat .social-float-icon { font-size: 18px; }
    #btnSocialFloat .social-float-label { font-size: 7px; max-width: 44px; }
}
.cs-entry-glow { animation: cs-entry-glow 1.4s ease-in-out infinite; }
#newsHeadline .nh-tk-cat.social { color: #e11d74; }
#newsHeadline .nh-tk-social-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cs-coach {
    position: fixed; z-index: 9500; display: flex; gap: 10px; align-items: flex-start;
    width: min(300px, calc(100vw - 16px)); box-sizing: border-box; padding: 12px;
    background: #fff; color: #101828; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    animation: cs-rise 0.25s ease;
}
.cs-coach::before { content: ''; position: absolute; left: -7px; top: 20px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
.cs-coach.cs-coach-left::before { left: auto; right: -7px; }
.cs-coach-face { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f1f3f6; position: relative; }
.cs-coach-body { min-width: 0; position: relative; }
.cs-coach-text { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; font-weight: 600; }
.cs-coach-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cs-coach-btn { border: 1px solid #e4e7ec; background: #fff; color: #101828; border-radius: 999px; padding: 7px 14px; font: 700 12.5px/1 inherit; cursor: pointer; }
.cs-coach-try { border: 0; color: #fff; background: linear-gradient(45deg, #fb5607, #ff006e 60%, #8338ec); }
body.dark-mode .cs-coach, body.dark-mode .cs-coach::before { background: #141b24; color: #e8edf3; }
body.dark-mode .cs-coach-btn:not(.cs-coach-try) { background: #1d2733; color: #e8edf3; border-color: #243042; }

/* Screenshot-button route: after the shot pick share / save / retake. */
.cs-vf-choice {
    position: absolute; left: 50%; bottom: calc(34px * var(--cs-s)); translate: -50% 0; pointer-events: auto;
    display: flex; gap: calc(10px * var(--cs-s)); padding: calc(10px * var(--cs-s)); border-radius: 22px;
    background: rgba(10, 14, 20, 0.6); backdrop-filter: blur(10px); animation: cs-rise 0.2s ease;
}
.cs-vf-choice-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: calc(84px * var(--cs-s));
    padding: calc(10px * var(--cs-s)) calc(12px * var(--cs-s)); border: 1px solid rgba(255,255,255,0.3); border-radius: 16px;
    background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; font: 700 var(--cs-fsm) system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
}
.cs-vf-choice-btn span { font-size: var(--cs-fxl); line-height: 1; }
.cs-vf-choice-btn:hover { background: rgba(255,255,255,0.24); }
.cs-vf-choice-btn:disabled { opacity: 0.7; cursor: default; }
.cs-vf-share { border: 0; background: linear-gradient(45deg, #fb5607, #ff006e 60%, #8338ec); }
.cs-vf-picked .cs-vf-bar { display: none; }
.cs-vf-picked .cs-vf-polaroid { animation: none; opacity: 1; scale: 1; rotate: -2deg; translate: -50% -58%; }
.cs-vf-picked .cs-vf-flash, .cs-vf-picked .cs-vf-blades { display: none; }
@keyframes cs-badge-pulse { 50% { transform: scale(1.12); } }
@keyframes cs-entry-glow { 0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 0 rgba(255, 0, 110, 0.6); } 50% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 8px rgba(255, 0, 110, 0); } }
@media (prefers-reduced-motion: reduce) { .cs-badge.is-new, .cs-entry-glow, .cs-coach, .cs-vf-choice { animation: none !important; } }

/* Compact photo board: one weekly row, then the newest posts. */
#citySocialView .cs-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "feed"; max-width: calc(1060px * var(--cs-s)); margin-inline: auto; gap: calc(24px * var(--cs-s)); }
#citySocialView .cs-aside { position: static; min-width: 0; }
#citySocialView.is-mine .cs-shell { grid-template-areas: "feed"; }
#citySocialView.is-mine .cs-aside { display: none; }
#citySocialMineBadge.cs-nav-badge { display: inline-flex; min-width: 1.5em; height: 1.5em; align-items: center; justify-content: center; padding-inline: .3em; border-radius: 999px; background: #ef446c; color: #fff; font-size: .8em; font-weight: 800; }
#citySocialMineBadge[hidden] { display: none; }
#citySocialView .cs-aside-note { display: none; }
#citySocialView .cs-top { padding: 0; background: transparent; border: 0; border-radius: 0; }
.cs-recent-title { margin: 0 0 calc(12px * var(--cs-s)); color: var(--cs-ink); font-size: var(--cs-fmd); font-weight: 800; }
.cs-tiles { --cs-tile-gap: calc(16px * var(--cs-s)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: calc(20px * var(--cs-s)) var(--cs-tile-gap); }
#citySocialWeekly.cs-top-list { --cs-tile-gap: calc(16px * var(--cs-s)); display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * var(--cs-tile-gap)) / 3); gap: var(--cs-tile-gap); overflow-x: auto; padding: 0 0 calc(5px * var(--cs-s)); scroll-snap-type: x proximity; }
.cs-tile { list-style: none; min-width: 0; margin: 0; scroll-snap-align: start; color: var(--cs-ink); }
.cs-tile-open { display: block; width: 100%; padding: 0; border: 0; border-radius: calc(14px * var(--cs-s)); background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.cs-tile-media { display: grid; place-items: center; position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: calc(14px * var(--cs-s)); background: var(--cs-chip); }
.cs-tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .15s ease; }
.cs-tile-open:hover img { transform: scale(1.035); }
.cs-tile-caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-height: 2.8em; margin-top: calc(8px * var(--cs-s)); font-size: var(--cs-fsm); line-height: 1.4; font-weight: 650; }
.cs-tile-rank { position: absolute; inset-block-start: calc(8px * var(--cs-s)); inset-inline-start: calc(8px * var(--cs-s)); display: grid; place-items: center; min-width: calc(28px * var(--cs-s)); height: calc(28px * var(--cs-s)); padding-inline: calc(5px * var(--cs-s)); border-radius: 50%; background: var(--cs-card); font-size: var(--cs-fmd); font-weight: 800; box-shadow: 0 2px 8px #0003; }
.cs-tile-meta { display: flex; align-items: center; justify-content: space-between; gap: calc(6px * var(--cs-s)); margin-top: calc(5px * var(--cs-s)); }
.cs-tile-author { display: inline-flex; align-items: center; gap: calc(5px * var(--cs-s)); min-width: 0; color: var(--cs-muted); font-size: var(--cs-fxs); text-decoration: none; }
.cs-tile-author > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-tile-author .cs-avatar { flex-shrink: 0; width: calc(23px * var(--cs-s)); height: calc(23px * var(--cs-s)); font-size: var(--cs-fxs); }
.cs-tile-stats { display: inline-flex; flex-shrink: 0; align-items: center; }
.cs-tile-like, .cs-tile-comment { display: inline-flex; flex-shrink: 0; align-items: center; gap: calc(4px * var(--cs-s)); padding: calc(5px * var(--cs-s)) 0 calc(5px * var(--cs-s)) calc(5px * var(--cs-s)); border: 0; background: transparent; color: var(--cs-muted); font: inherit; font-size: var(--cs-fxs); cursor: pointer; }
.cs-tile-stats .cs-icon { width: calc(17px * var(--cs-s)); height: calc(17px * var(--cs-s)); }
.cs-tile-like .cs-icon { color: var(--cs-heart); }
.cs-tile-like.is-liked .cs-icon svg { fill: var(--cs-heart); }
.cs-tile-details { display: flex; align-items: baseline; gap: calc(6px * var(--cs-s)); margin-top: calc(5px * var(--cs-s)); min-width: 0; color: var(--cs-muted); font-size: var(--cs-fxs); }
.cs-map-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cs-muted); font-size: var(--cs-fxs); }
.cs-tile-details .cs-map-name { flex: 1; }
.cs-tile-details .cs-time, .cs-sub .cs-time { flex-shrink: 0; white-space: nowrap; }
.cs-tiles > :is(.cs-empty, .cs-skeleton) { grid-column: 1 / -1; }
#citySocialWeekly > .cs-empty { grid-column: 1 / -1; min-width: 0; }
.cs-tile-failed { padding: calc(10px * var(--cs-s)); color: var(--cs-muted); font-size: var(--cs-fxs); }

/* A shared, focused photo reader, including public profile galleries. */
.cs-post-dialog { width: min(1200px, 96vw); height: min(760px, 90vh); height: min(760px, 90dvh); max-width: none; max-height: none; overflow: hidden; }
.cs-post-dialog .cs-detail-card.cs-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); grid-template-rows: auto auto minmax(0, 1fr); width: 100%; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
.cs-detail-card > .cs-card-head { grid-column: 2; grid-row: 1; padding-inline-end: calc(48px * var(--cs-s)); }
.cs-detail-card > .cs-media { grid-column: 1; grid-row: 1 / 4; display: grid; align-items: center; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; background: #080d12; }
.cs-detail-card > .cs-media img { width: 100%; height: 100%; object-fit: contain; }
.cs-detail-card > .cs-actions { grid-column: 2; grid-row: 2; }
.cs-detail-card > .cs-card-body { grid-column: 2; grid-row: 3; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cs-detail-card .cs-caption { margin: 0; }
.cs-detail-card .cs-comments { width: 100%; }
.cs-detail-card .cs-comment-list { max-height: none; overflow: visible; }
.cs-post-dialog .cs-dialog-close { z-index: 3; inset-block-start: calc(7px * var(--cs-s)); inset-inline-end: calc(7px * var(--cs-s)); }
.cs-profile { color: var(--cs-ink); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.cs-profile [hidden] { display: none !important; }
.cs-profile :is(button, textarea) { font-family: inherit; }
.cs-profile :is(button, a, textarea, summary):focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.cs-profile-grid { margin-top: calc(16px * var(--cs-s)); }
.cs-profile .cs-post-dialog { text-align: start; }
@media (max-width: 860px) {
    .cs-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #citySocialWeekly.cs-top-list { grid-auto-columns: calc((100% - 2 * var(--cs-tile-gap)) / 3); }
}
@media (max-width: 600px) {
    .cs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); --cs-tile-gap: calc(10px * var(--cs-s)); }
    #citySocialWeekly.cs-top-list { --cs-tile-gap: calc(10px * var(--cs-s)); grid-auto-columns: calc((100% - var(--cs-tile-gap)) / 2); }
    #citySocialView .cs-shell { padding-inline: calc(12px * var(--cs-s)); }
    .cs-post-dialog { width: 96vw; height: 92vh; height: 92dvh; overflow-y: auto; }
    .cs-post-dialog .cs-detail-card.cs-card { display: flex; flex-direction: column; height: auto; min-height: 100%; }
    .cs-detail-card > .cs-media { order: -1; height: auto; min-height: 0; max-height: 48vh; max-height: 48dvh; aspect-ratio: 16 / 9; flex-shrink: 0; }
    .cs-detail-card > .cs-card-head { padding-inline-end: calc(12px * var(--cs-s)); }
    .cs-detail-card > .cs-card-body { overflow: visible; }
}
