:root{--surface:#fff;--surface-raised:#fff;--soft:#f2f6fc;--glass:rgba(255,255,255,.96)}
:root[data-theme=dark]{color-scheme:dark;--bg:#151c28;--surface:#1e2837;--surface-raised:#263244;--soft:#243145;--glass:rgba(30,40,55,.96);--ink:#edf2fa;--muted:#a8b6ca;--line:#354358;--pale:#283a54;--blue:#80b2ff;--blue-dark:#317bee;--radius:22px}
:root[data-theme=dark] .primary,:root[data-theme=dark] .mobile-nav .new,:root[data-theme=dark] .bubble.mine{background:#286bdd;color:#fff}
:root[data-theme=dark] .btn:hover{background:#334762}
:root[data-theme=dark] .primary:hover{background:#347cec}
:root[data-theme=dark] :is(input,textarea,select,.global-search){border-color:var(--line);background:var(--soft);color:var(--ink)}
:root[data-theme=dark] :is(.card,.sidebar,.topbar,.mobile-nav,dialog,.modal-head,.chat-thread,.editor-footer,.auth,.setup-card,.outline,.upload-icon,.compare-button){background:var(--surface);color:var(--ink)}
:root[data-theme=dark] :is(.topbar,.mobile-nav){background:var(--glass)}
:root[data-theme=dark] :is(.nav a:hover,.nav a.active,.bubble,.unread,.profile-photo-picker,.media-upload-area,.editor-preview,.selected-media-frame,.music-result,.destination-options button,.auth-tabs .active){background:var(--soft);border-color:var(--line)}
:root[data-theme=dark] :is(.profile-cover,.avatar){background:#2b3d58;border-color:var(--line)}
:root[data-theme=dark] .avatar.large{border-color:var(--surface)}
:root[data-theme=dark] .message-list{background:var(--bg)}
:root[data-theme=dark] :is(.form-error,.editor-error,.danger){background:#442b39;color:#ffb8c6}
:root[data-theme=dark] .editor-confirm{background:#423827;color:#f7dab2}
:root[data-theme=dark] .photo-ready{background:#204637;color:#a3e6c2;border-color:var(--surface)}
:root[data-theme=dark] input::placeholder,:root[data-theme=dark] textarea::placeholder{color:#9bacbf}
:root[data-theme=dark] .bubble.mine small{color:#deebff}
:root[data-theme=dark] .destination-options button[aria-checked=true]{background:#294572;border-color:#7dadf7}
:root[data-theme=dark] .music-result[aria-pressed=true]{background:#2d4565;border-color:var(--blue)}
.theme-options{display:flex;gap:10px;flex-wrap:wrap}.theme-options button{flex:1}.theme-options [aria-pressed=true]{border-color:var(--blue);background:var(--pale);color:var(--blue)}
.profile-main{justify-content:flex-start!important;min-height:0!important}.profile-actions{display:flex;align-items:center;gap:10px;margin:22px 0 8px;width:100%}.profile-actions .btn{flex:1;min-height:44px}.profile-actions .icon-btn{border:1px solid var(--line);border-radius:12px;height:44px;width:44px;background:var(--surface)}.profile-card .profile-main{margin-bottom:16px}.profile-card .bio{margin-top:14px}.profile-actions+.stats{margin-top:20px}
#music-choice:not(:empty){padding:18px;border:1px solid var(--blue);border-radius:16px;background:var(--pale);margin:16px 0 20px}#music-choice audio{width:100%}.music-result[aria-pressed=true]{border-color:var(--blue);background:var(--pale)}
.reaction-choices{display:flex;justify-content:space-between;gap:4px;padding:10px 0;flex-wrap:wrap}.reaction-choices button{display:flex;flex:1;min-width:42px;flex-direction:column;align-items:center;gap:5px;border:1px solid transparent;border-radius:14px;padding:9px 2px;transition:transform .15s,background .15s}.reaction-choices button:hover{transform:translateY(-3px);background:var(--pale)}.reaction-choices button[aria-pressed=true]{background:var(--pale);border-color:var(--blue)}.reaction-choices button>span{font-size:28px;line-height:1.2}.reaction-choices small{font-size:10px}.reaction-symbol{font-size:23px;line-height:1}.reaction-symbol:first-child{color:#ee5279}.reaction-trigger{min-height:44px}.reaction-total{font-size:14px}
/* Fullscreen on phones; uninterrupted portrait canvas on desktop. */
#modal.story-full{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#121925;color:#fff;overflow:hidden;position:fixed;inset:0}.story-full::backdrop{background:#121925}.story-stage{height:100%;width:100%;max-width:520px;margin:auto;position:relative;display:flex;flex-direction:column;background:#1b2331;isolation:isolate}.story-progress{display:flex;gap:4px;position:absolute;left:12px;right:12px;top:calc(10px + env(safe-area-inset-top));z-index:6}.story-progress>span{height:3px;background:#ffffff50;flex:1;border-radius:6px;overflow:hidden}.story-progress i{display:block;width:100%;height:100%;background:#fff;transform:scaleX(0);transform-origin:left;will-change:transform}.story-progress i.complete{transform:scaleX(1)}.story-header{position:absolute;top:0;left:0;right:0;z-index:5;display:flex;align-items:center;gap:7px;padding:calc(25px + env(safe-area-inset-top)) 12px 30px;background:linear-gradient(#101722dd,transparent);color:#fff}.story-header .avatar{width:35px;height:35px}.story-author{flex:1;min-width:0;display:grid;font-size:13px;overflow:hidden}.story-author strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.story-author small{font-size:11px;color:#e1e6f0}.story-header .icon-btn{width:32px;height:40px;color:#fff}.story-media{position:relative;flex:1;min-height:0;display:grid;place-items:center;touch-action:pan-y}.story-media>img,.story-media>video{display:block;width:100%;height:100%;position:absolute;inset:0;object-fit:contain}.story-tap{position:absolute;top:95px;bottom:0;width:32%;z-index:2;border-radius:0;background:transparent}.story-tap.prev{left:0}.story-tap.next{right:0}.story-tap:focus-visible{outline:2px solid #fff;outline-offset:-4px}.story-interaction{position:relative;flex-shrink:0;padding:8px 16px calc(14px + env(safe-area-inset-bottom));background:#1b2331;color:#fff;z-index:4}.story-text{font-size:13px;max-height:65px;overflow:auto;white-space:pre-wrap;padding-bottom:8px}.story-interaction .reaction-choices{padding:0 0 9px;flex-wrap:nowrap}.story-interaction .reaction-choices button{padding:6px 0;min-width:0}.story-interaction .reaction-choices small{display:none}.story-interaction .reaction-choices button>span{font-size:24px}.story-interaction .reaction-choices button[aria-pressed=true],.story-interaction .reaction-choices button:hover{background:#35445b;border-color:#7fb0ff}#story-reply{display:flex;gap:8px;align-items:center}#story-reply input{border:1px solid #728098;background:transparent;color:#fff;border-radius:28px;font-size:14px;min-height:44px}#story-reply input::placeholder{color:#c3cddc}#story-reply .icon-btn{color:#fff}.story-owner-note{color:#bac8dc;font-size:12px;text-align:center;padding:10px}.story-full .icon-btn:hover{background:#ffffff20}
.camera-dialog{width:min(100vw,520px);max-width:100vw;height:100dvh;max-height:100dvh;padding:0;border:0;margin:auto;background:#1b2331;color:#fff;border-radius:20px;overflow:hidden}.camera-dialog[open]{display:flex;flex-direction:column}.camera-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;color:#fff}.camera-header>div{display:grid;gap:3px}.camera-header small{font-size:11px;color:#aebed3}.camera-stage{position:relative;min-height:0;flex:1;display:flex;justify-content:center;overflow:hidden;background:#121925;align-self:center;aspect-ratio:9/16;max-width:100%}.camera-stage canvas{width:100%;height:100%;object-fit:contain;touch-action:none}.camera-guide{position:absolute;left:50%;top:42%;width:32%;height:24%;border:1px dashed #ffffff77;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}.camera-loading{position:absolute;top:45%;left:0;right:0;text-align:center;color:#fff}.camera-hint{font-size:11px;color:#b9c8dc;padding:8px 16px;line-height:1.4;text-align:center;min-height:44px}.camera-effects{display:flex;overflow-x:auto;gap:7px;padding:0 14px 10px;flex-shrink:0}.camera-effects button{color:#e0e8f3;white-space:nowrap;border:1px solid #506079;border-radius:24px;padding:9px 12px;font-size:12px}.camera-effects button[aria-pressed=true]{background:#e9f1ff;color:#193555;border-color:#e9f1ff}.camera-size{display:flex;align-items:center;gap:10px;padding:0 18px;font-size:11px;color:#becde0;font-weight:400}.camera-size input{padding:0;flex:1;accent-color:#8bb8ff}.camera-controls{display:flex;justify-content:space-around;align-items:center;padding:12px 18px calc(14px + env(safe-area-inset-bottom));flex-shrink:0}.camera-controls .outline{background:#2b394f;color:#fff;border-color:#627089}.camera-controls .icon-btn{color:#fff}.camera-shutter{display:grid;place-items:center;border-radius:50%;width:62px;height:62px;border:4px solid #acbdd3;box-shadow:inset 0 0 0 3px #1b2331;background:#fff;color:#23344e}.camera-controls .recording{background:#ad354c;color:#fff}.camera-dialog::backdrop{background:#111827ed}
@media(max-width:600px){.profile-actions{margin-top:18px;gap:8px}.profile-actions .btn{padding:10px 12px;font-size:13px}.camera-dialog{border-radius:0;margin:0}.camera-header{padding-top:calc(10px + env(safe-area-inset-top))}.reaction-choices{gap:2px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
:root[data-theme=dark] body{background:var(--bg)}
:root[data-theme=dark] .btn.outline{background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] :is(.post-media,.media-upload-button:hover,.ratio-options button[aria-pressed=true],.search-submit:hover){background:var(--soft)}
:root[data-theme=dark] :is(.media-upload-button small,.editor-preview-top>span,.editor-preview-bottom,.adjustment output,.bubble small){color:var(--muted)}
:root[data-theme=dark] .profile-photo-actions .media-status{color:#9ddcbb}
:root[data-theme=dark] .editor-confirm button[data-editor=continue]{background:var(--surface-raised);color:var(--ink)}
.reaction-art{width:28px;height:28px;display:block;fill:none;stroke-width:1.3}.reaction-symbol{display:inline-flex;align-items:center}.reaction-choices .reaction-art{width:32px;height:32px}.story-interaction .reaction-art{width:27px;height:27px}.story-owner-note{display:block;width:100%}.camera-size button{color:#bcd6ff;border:1px solid #526c8b;border-radius:8px;padding:4px 6px;font-size:11px}
/* Compact album player: the catalog preview plays in full, without a trim control. */
.profile-music.music-mini{position:relative;display:flex;align-items:center;gap:11px;padding:10px 12px;margin:16px 0;border:1px solid var(--line);border-radius:14px;background:var(--bg);min-width:0;overflow:hidden;min-height:72px}.music-artwork{position:relative;display:grid;place-items:center;width:46px;height:46px;flex:0 0 46px;border-radius:9px;overflow:hidden;background:linear-gradient(140deg,#45628a,#817aaa);color:#fff}.music-artwork>svg{width:23px;height:23px}.music-artwork img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.music-mini-info{display:flex;flex-direction:column;min-width:0;gap:1px;flex:1}.music-mini-info strong{font-size:13px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.music-mini-info small{font-size:11px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.music-mini-status{font-size:10px;line-height:1.4;color:var(--muted)}.music-mini-play{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;padding:9px;border-radius:50%;background:var(--surface);color:var(--ink);border:1px solid var(--line)}.music-mini-play:hover{background:var(--pale);color:var(--blue)}.music-mini-play svg{width:18px;height:18px}.music-mini-audio{display:none}.music-mini-progress{position:absolute;bottom:0;left:0;width:100%;height:2px;background:transparent}.music-mini-progress i{display:block;height:100%;background:var(--blue);transform:scaleX(0);transform-origin:left}.music-mini.is-playing .music-mini-status{color:var(--blue)}
#music-choice:not(:empty){padding:12px;gap:10px;border:1px solid var(--line);background:var(--bg);border-radius:15px;margin:14px 0}#music-choice .music-mini{padding:0 0 10px;margin:0;border:0;border-radius:0;background:transparent;min-height:56px}#music-choice .music-choice-help{font-size:11px;color:var(--muted);margin:0}#music-choice>.btn{min-height:40px;padding:9px 14px;font-size:13px}#music-results{gap:8px}.music-result{display:flex;align-items:center;gap:11px;min-width:0;padding:11px 12px;text-align:left;border-radius:13px}.music-result .music-artwork{display:grid;width:42px;height:42px;flex:0 0 42px}.music-result .music-result-copy{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;flex:1;margin:0;color:var(--ink);font-size:13px}.music-result-copy strong,.music-result-copy small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.music-result .music-result-select{display:flex;align-items:center;justify-content:center;margin:0;flex:0 0 24px}.music-result-select svg{width:18px;height:18px}.music-result[aria-pressed=true] .music-result-select{color:var(--blue)}
