/* 21 Social extends the existing player surface and its theme tokens. */
.media-mode-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-mode-switch button { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:9px; min-height:48px; padding:8px 13px; border:1px solid transparent; border-radius:15px; color:var(--muted); text-align:left; font:inherit; cursor:pointer; background:rgba(255,255,255,.025); }
.media-mode-switch button > span { color:var(--accent,#b66cff); font-size:1.15rem; }
.media-mode-switch button > small { min-width:24px; padding:3px 7px; border-radius:999px; text-align:center; background:rgba(255,255,255,.08); }
.media-mode-switch button.active { color:#fff; border-color:rgba(190,94,255,.55); background:linear-gradient(135deg,rgba(111,35,160,.34),rgba(113,0,45,.3)); box-shadow:inset 0 0 22px rgba(190,94,255,.12); }
.media-mode-switch button:focus-visible,.media-mode-switch a:focus-visible { outline:2px solid var(--purple-2); outline-offset:2px; }
.social-mode-panel { display:none; }
.app-shell.social-active .social-mode-panel { display:block; }
.app-shell.social-active > .app-main,.app-shell.social-active > .empty-state { position:absolute!important; left:-200vw!important; top:0!important; width:1px!important; height:1px!important; min-height:0!important; overflow:hidden!important; visibility:hidden!important; pointer-events:none!important; }
.social-surface { max-width:1020px; margin:0 auto 32px; color:var(--text); }
.social-surface * { box-sizing:border-box; }
.social-surface .social-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:22px 24px; margin-bottom:14px; border:1px solid var(--line); border-radius:var(--radius); background:linear-gradient(155deg,var(--panel),rgba(42,11,36,.8)); box-shadow:var(--shadow); }
.social-surface h2 { margin:3px 0; font-size:1.7rem; }
.social-surface .social-heading p { margin:4px 0 0; color:var(--muted); }
.social-surface .social-tools { display:flex; gap:7px; flex-wrap:wrap; }
.social-surface button,.social-surface .primary { color:var(--text); border:1px solid var(--line-strong); background:rgba(139,59,162,.16); padding:9px 12px; border-radius:12px; font:inherit; cursor:pointer; }
.social-surface button:hover,.social-surface button:focus-visible { background:rgba(154,76,224,.3); }
.social-surface button:disabled { opacity:.5; cursor:not-allowed; }
.social-surface a { color:var(--purple-2); text-decoration:none; }
.social-surface a:hover { text-decoration:underline; }
.social-surface .composer,.social-surface .post,.social-surface .profile-card,.social-surface .album-card { border:1px solid var(--line); background:linear-gradient(155deg,rgba(30,17,37,.91),rgba(12,7,16,.96)); border-radius:20px; margin-bottom:12px; padding:19px; box-shadow:0 18px 45px rgba(0,0,0,.2); }
.social-surface .row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.social-surface textarea,.social-surface select,.social-surface input { color:var(--text); background:rgba(5,4,9,.6); border:1px solid var(--line-strong); border-radius:10px; padding:10px; font:inherit; max-width:100%; }
.social-surface .composer textarea { display:block; width:100%; min-height:100px; margin:14px 0; resize:vertical; }
.social-surface .compose-actions { justify-content:flex-start; }
.social-surface .compose-actions #postSend { margin-left:auto; background:linear-gradient(135deg,rgba(130,43,174,.75),rgba(112,19,56,.75)); }
.social-surface .filebtn { cursor:pointer; color:var(--purple-2); padding:9px 0; }
.social-surface .filters { display:flex; gap:7px; overflow:auto; margin:0 0 12px; padding:4px 0; }
.social-surface .filters button { white-space:nowrap; background:var(--panel); }
.social-surface .filters button.active { border-color:var(--purple-2); color:#fff; background:rgba(154,76,224,.27); }
.social-surface .post header { display:flex; gap:11px; align-items:center; }
.social-surface .post .avatar { width:42px; height:42px; object-fit:cover; border-radius:50%; background:var(--panel-2); }
.social-surface .post h3 { margin:0; font-size:1rem; }
.social-surface .post .meta,.social-surface .post small,.social-surface .empty { color:var(--muted); font-size:.82rem; }
.social-surface .post .body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin:16px 0; }
.social-surface .media-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
.social-surface .media-grid img,.social-surface .media-grid video { display:block; width:100%; max-height:450px; object-fit:contain; border-radius:12px; background:#07050a; }
.social-surface .actions { display:flex; gap:4px; flex-wrap:wrap; border-top:1px solid var(--line); padding-top:9px; margin-top:13px; }
.social-surface .actions button { padding:6px 8px; border:0; background:transparent; color:var(--soft); }
.social-surface .actions button.selected { color:#fff; background:rgba(154,76,224,.25); }
.social-surface .comments { margin-top:12px; }
.social-surface .comment { margin:10px 0; padding:7px 12px; border-left:2px solid var(--purple); background:rgba(255,255,255,.02); }
.social-surface .comment p { margin:5px 0; }
.social-surface .comment-box { display:flex; gap:7px; margin-top:10px; }
.social-surface .comment-box input { min-width:0; flex:1; }
.social-surface .track-card,.social-surface .album-card { padding:12px; border:1px solid var(--line); border-radius:14px; }
.social-surface .track-card audio { width:100%; margin-top:8px; }
.social-surface #loadMore { display:block; margin:16px auto; }
.social-surface .auth-form-mini { display:grid; gap:10px; }
.social-surface #feedToast { display:none; position:fixed; z-index:1000; right:16px; bottom:16px; max-width:min(350px,90vw); padding:12px 16px; border:1px solid var(--line-strong); border-radius:13px; color:#fff; background:#472553; }
.feed-landing #authOverlay { color:var(--text); background:linear-gradient(150deg,#23132d,#100a17); border:1px solid var(--line-strong); border-radius:22px; width:min(440px,calc(100% - 24px)); max-height:90vh; overflow:auto; padding:24px; }
.feed-landing #authOverlay::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(5px); }
.feed-landing #authOverlay .auth-tabs { display:flex; gap:8px; margin:12px 0 18px; }
.feed-landing #authOverlay .auth-tabs button { flex:1; padding:10px; border:1px solid var(--line-strong); border-radius:11px; color:var(--text); background:var(--panel); cursor:pointer; }
.feed-landing #authOverlay .auth-tabs button.active { background:rgba(154,76,224,.32); }
.feed-landing #authOverlay form label { display:grid; gap:5px; margin:12px 0; }
.feed-landing #authOverlay input { width:100%; color:var(--text); background:var(--bg-2); border:1px solid var(--line-strong); border-radius:10px; padding:11px; }
.feed-landing #authOverlay form button { width:100%; padding:12px; border:1px solid var(--line-strong); border-radius:12px; background:linear-gradient(135deg,#73349e,#781d4d); color:#fff; cursor:pointer; }
.feed-landing #authOverlay form .password-control > button.password-visibility { width:40px!important; min-width:40px!important; height:40px!important; padding:0!important; border:0!important; background:transparent!important; }
.feed-landing #authOverlay .close { float:right; color:var(--text); background:transparent; border:0; font-size:1.5rem; cursor:pointer; }
.feed-landing .landing-note { max-width:1020px; margin:12px auto; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.feed-landing .landing-note.error { border-color:var(--danger); }
@media(max-width:700px) {
 .media-mode-switch { grid-template-columns:repeat(3,minmax(0,1fr)); margin-inline:8px; gap:5px; padding:5px; }
 .media-mode-switch button { grid-template-columns:1fr; min-height:42px; padding:7px 5px; text-align:center; }
 .media-mode-switch button > span,.media-mode-switch button > small { display:none; }
 .media-mode-switch a { grid-template-columns:1fr; min-height:42px; padding:7px 5px; text-align:center; }
 .media-mode-switch a > small { display:none; }
 .social-surface .social-heading,.social-surface .composer,.social-surface .post { padding:14px; }
 .social-surface .social-heading { align-items:flex-start; }
 .social-surface .compose-actions #postSend { margin-left:0; }
 .social-surface .compose-actions select { max-width:100%; flex:1; }
}

.social-surface #loadMore[hidden], .social-surface #feedToast[hidden] { display:none!important; }
/* Die Kopfzeile folgt denselben Rundungen wie die Player-Bereiche. */
.app-shell > .v5-topbar { border-radius:20px !important; padding:12px 16px !important; margin-bottom:12px; overflow:hidden; }
.feed-landing .app-shell { width:min(1020px,calc(100% - 28px)); }
.feed-landing .top-actions.account-actions > .account-chip-button { display:flex !important; align-items:center !important; justify-content:center !important; min-width:138px !important; text-align:center !important; padding:5px 14px !important; }
.social-surface .person-search { display:grid; gap:8px; margin:12px 0; }
.social-surface .person-search input { width:100%; }
.social-surface .person-row { display:flex; align-items:center; gap:9px; padding:9px 0; border-bottom:1px solid var(--line); }
.social-surface .person-row .avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; }
.social-surface .person-row button:first-of-type { flex:1; text-align:left; background:transparent; border:0; }
.social-surface .person-row small { color:var(--muted); }
@media(max-width:700px) { .app-shell > .v5-topbar { border-radius:16px !important; padding:10px 12px !important; } .feed-landing .app-shell { width:100% !important; } }
.social-surface .feed-image-preview { display:block; max-width:100%; max-height:70vh; margin:auto; object-fit:contain; }
/* Beiträge zuerst: Werkzeuge bleiben erreichbar, ohne den Feed zu verdrängen. */
.social-surface .social-heading { min-height:42px; padding:0 2px; margin:6px 0 9px; border:0; border-radius:0; background:none; box-shadow:none; flex-wrap:nowrap; }
.social-surface .social-heading h2 { margin:0; font-size:1.15rem; line-height:1.3; }
.social-surface .social-tools { position:relative; align-items:center; flex-wrap:nowrap; }
.social-surface .social-tools > button { padding:7px 11px; white-space:nowrap; }
.social-surface #openComposer { background:linear-gradient(135deg,rgba(130,43,174,.6),rgba(112,19,56,.6)); }
.social-surface .social-menu { position:absolute; z-index:30; right:0; top:calc(100% + 7px); width:min(245px,85vw); display:grid; gap:4px; padding:8px; border:1px solid var(--line-strong); border-radius:16px; background:var(--panel-2); box-shadow:0 16px 45px rgba(0,0,0,.55); }
.social-surface .social-menu button { width:100%; text-align:left; background:transparent; border:0; padding:10px 12px; }
.social-surface .social-menu[hidden],.social-surface .social-menu button[hidden],.social-surface .composer[hidden] { display:none!important; }
.social-surface #feedNotificationBadge { margin-left:5px; color:#fff; }
.social-surface .filters { margin-bottom:8px; padding:2px 0; }
.social-surface .filters button { padding:7px 10px; }
@media(max-width:700px) { .social-surface .social-heading { padding:0 3px; margin:4px 0 8px; } .social-surface .social-heading h2 { font-size:1.05rem; } .social-surface .social-tools { gap:4px; } .social-surface .social-tools > button { padding:7px 8px; } }

/* Reading width and type scale follow the player while giving posts a calmer line length. */
.social-surface { width:min(100%,800px); max-width:800px; font-size:15px; }
.social-surface .post { padding:22px 24px; }
.social-surface .post .body { font-size:17px; line-height:1.65; letter-spacing:0; margin:18px 0; }
.social-surface .post h3 { display:flex; align-items:center; gap:7px; flex-wrap:wrap; font-size:15px; }
.social-surface .post .meta,.social-surface .post small { font-size:12px; line-height:1.4; }
.social-surface .post-hashtag { color:var(--purple-2); font-weight:700; overflow-wrap:anywhere; }
.social-surface .post-hashtag:hover,.social-surface .post-hashtag:focus-visible { text-decoration:underline; }
.social-surface .role-badge { display:inline-flex; align-items:center; padding:2px 8px; border:1px solid var(--line-strong); border-radius:999px; color:var(--muted); background:rgba(255,255,255,.04); font-size:11px; line-height:1.4; font-weight:650; vertical-align:middle; }
.social-surface .role-masteradmin { color:#ffdba7; border-color:rgba(255,188,94,.48); background:rgba(122,69,27,.26); }
.social-surface .role-admin,.social-surface .role-moderator { color:#e5bcfa; border-color:rgba(190,94,255,.4); background:rgba(111,35,160,.25); }
.social-surface .composer-text-label { display:block; margin-top:14px; color:var(--soft); font-size:13px; }
.social-surface .composer #postText { display:block; width:100%; min-height:190px; max-height:75vh; margin:8px 0 14px; resize:vertical; font-size:16px; line-height:1.55; }
.social-surface .hashtag-count { display:block; margin:-7px 0 12px; color:var(--muted); font-size:12px; }
.social-surface .hashtag-count.over-limit { color:#ff9b9b; font-weight:700; }
.social-surface .feed-filter-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.social-surface .feed-filter-row .filters { min-width:0; flex:1; margin:0; }
.social-surface .hashtag-search { display:flex; align-items:center; flex:0 0 auto; min-width:0; border:1px solid var(--line-strong); border-radius:12px; background:var(--panel); }
.social-surface .hashtag-search label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.social-surface .hashtag-search input { width:130px; min-width:0; padding:8px 4px 8px 10px; border:0; background:transparent; font-size:14px; }
.social-surface .hashtag-search button { border:0; background:transparent; padding:6px 8px; font-size:18px; }
.social-surface .hashtag-search button[hidden] { display:none!important; }
@media(max-width:700px) {
 .social-surface { width:100%; font-size:14px; }
 .social-surface .post { padding:15px; }
 .social-surface .post .body { font-size:16px; }
 .social-surface .feed-filter-row { flex-wrap:wrap; gap:4px; }
 .social-surface .feed-filter-row .filters { flex:1 1 100%; }
 .social-surface .hashtag-search { width:100%; }
 .social-surface .hashtag-search input { flex:1; width:auto; }
}

/* Selected media stay visible before publishing and while editing. */
.social-surface .selected-media { margin:12px 0; padding:12px; border:1px solid var(--line-strong); border-radius:14px; background:var(--panel); }
.social-surface .selected-media-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin-top:10px; }
.social-surface .selected-media-item { min-width:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--bg-2); }
.social-surface .selected-media-item img,.social-surface .selected-media-item video { display:block; width:100%; height:150px; object-fit:contain; background:#07050a; }
.social-surface .selected-media-item > div { display:flex; align-items:center; flex-wrap:wrap; gap:5px; padding:7px; }
.social-surface .selected-media-item span { min-width:0; flex:1 1 100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px; }
.social-surface .selected-media-item button { padding:5px 8px; font-size:12px; }
.social-surface .selected-media[hidden] { display:none!important; }
.social-surface .selected-music { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0; padding:10px 12px; border:1px solid var(--line-strong); border-radius:12px; background:var(--panel); overflow-wrap:anywhere; }
.social-surface .selected-music[hidden] { display:none!important; }
.social-surface .edit-media-actions { display:flex; gap:8px; flex-wrap:wrap; }
.social-surface .actions .reaction-button { display:inline-flex; align-items:center; justify-content:center; gap:2px; flex:0 0 52px; width:52px; min-width:52px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.social-surface .actions .reaction-count { min-width:1ch; text-align:center; font-size:12px; }
/* The modal lives at document level, outside the player and embedded WebView layout. */
body.feed-modal-open { overflow:hidden; }
.feed-modal.social-surface { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; width:100%; max-width:none; height:100dvh; margin:0; padding:12px; }
.feed-modal[hidden] { display:none!important; }
.feed-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.82); }
.feed-modal-panel { position:relative; z-index:1; display:flex; flex-direction:column; width:min(680px,100%); min-width:0; max-height:calc(100dvh - 24px); overflow:hidden; padding:0; border:1px solid var(--line-strong); border-radius:20px; color:var(--text); background:linear-gradient(155deg,#211329,#110b18); box-shadow:0 24px 70px rgba(0,0,0,.75); }
.feed-modal-toolbar { display:flex; justify-content:flex-end; flex:none; padding:9px 12px 0; }
.feed-modal-panel .close { flex:none; min-width:42px; min-height:42px; font-size:24px; }
.feed-modal-panel #dialogContent { min-width:0; min-height:0; overflow:auto; padding:0 20px 20px; overscroll-behavior:contain; }
.feed-modal-panel h2 { margin:4px 0 16px; }
.feed-modal-panel .dialog-actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.feed-modal-panel .auth-form-mini { display:grid; gap:10px; }
.feed-modal-panel .auth-form-mini label { display:grid; gap:7px; }
.feed-modal-panel textarea { width:100%; min-height:150px; max-height:65dvh; resize:vertical; font-size:16px; line-height:1.55; }
.feed-modal.edit-post-dialog .feed-modal-panel { width:min(860px,100%); }
.feed-modal.edit-post-dialog textarea[name="text"] { min-height:280px; }
.feed-modal .feed-image-preview { display:block; max-width:100%; max-height:calc(100dvh - 120px); width:auto; height:auto; margin:auto; object-fit:contain; }
.feed-modal.image-dialog .feed-modal-panel { width:min(100%,1100px); background:#080609; border:0; box-shadow:none; }
.feed-modal.image-dialog .feed-modal-backdrop { background:rgba(0,0,0,.92); }
.feed-modal.image-dialog #dialogContent { text-align:center; }
.feed-modal.image-dialog #dialogContent h2 { font-size:1rem; text-align:left; }
.feed-modal .feed-image-error[hidden] { display:none!important; }
@media(max-width:700px) { .feed-modal.social-surface { padding:0; } .feed-modal-panel { width:100%; max-height:100dvh; min-height:100dvh; border-radius:0; } .feed-modal-panel #dialogContent { padding:0 16px 20px; } .feed-modal.edit-post-dialog textarea[name="text"] { min-height:230px; } }
