/* One palette shared by all app surfaces. */
:root{--surface:#fff;--surface-alt:#f4f3f9;--text:#292c3e;--muted:#62677b;--line:#e5e6ee;--accent:#745bd0;--accent-ink:#fff;--tint:#eee9fa;--sidebar:#24263c;--sidebar-text:#c8c9db;--wall-image:none}
:root[data-theme=dark]{color-scheme:dark;--bg:#101319;--surface:#1a1e27;--surface-alt:#232836;--text:#eef0f6;--muted:#a6aec3;--line:#343b4c;--accent:#baa5ff;--accent-ink:#201733;--tint:#302840;--sidebar:#141720;--sidebar-text:#c9cde0}
:root[data-theme=cyber]{color-scheme:dark;--bg:#0b101c;--surface:#111b2d;--surface-alt:#19243a;--text:#e7f8ff;--muted:#9cbed0;--line:#2e405c;--accent:#53edeb;--accent-ink:#071e27;--tint:#123c49;--sidebar:#0a1326;--sidebar-text:#bad9e7}
:root[data-theme=forest]{color-scheme:dark;--bg:#101711;--surface:#1b251b;--surface-alt:#263226;--text:#ebf2de;--muted:#afbea0;--line:#3b4a34;--accent:#b8d777;--accent-ink:#202b0f;--tint:#344322;--sidebar:#121b12;--sidebar-text:#c5d0b7}
:root[data-theme=rose]{color-scheme:light;--bg:#fff4f7;--surface:#fff;--surface-alt:#fff0f5;--text:#4a2a3d;--muted:#80586f;--line:#f1dae4;--accent:#b93676;--accent-ink:#fff;--tint:#fbe3ee;--sidebar:#47263e;--sidebar-text:#eed0e1}
:root[data-theme=ocean]{color-scheme:light;--bg:#edf7fa;--surface:#fff;--surface-alt:#eef8fa;--text:#203e4a;--muted:#526e7a;--line:#d5e7eb;--accent:#13788b;--accent-ink:#fff;--tint:#d8eef2;--sidebar:#173f4e;--sidebar-text:#c4e4ed}
:root[data-wallpaper=garden]{--wall-image:url('wallpapers/night-garden-v1.png');--wall-size:cover}
:root[data-wallpaper=coast]{--wall-image:url('wallpapers/coastal-dawn-v1.png');--wall-size:cover}
body{background:var(--bg);color:var(--text)}
header,.card,.chat-workspace,.room-rail,.conversation-head,.compose,.message-draft,.auth,.profile-overview,.service-tile,.dialog-entry,.album,.profile-fields input,.profile-fields select{background:var(--surface);color:var(--text);border-color:var(--line)}
.brand,.profile-intro h2,.conversation-head b,.room-link b,h1,h2,h3,h4,label,.message-author strong,.public-conversation .message-author strong,.public-conversation .message-body{color:var(--text)}
p,.muted,.profile-region,.chat-demographics,.public-conversation .chat-demographics,.public-conversation .message time,.message time,.room-link small,.rail-label,.profile-bio{color:var(--muted)}
aside{background:var(--sidebar)}aside a{color:var(--sidebar-text)}aside a.active{background:var(--accent);color:var(--accent-ink)}
input,textarea,select{background:var(--surface-alt);border-color:var(--line);color:var(--text)}
button,.btn{background:var(--surface);border-color:var(--line);color:var(--text);min-height:42px;border-radius:12px;transition:background .15s,transform .15s}
button:hover,.btn:hover{background:var(--tint);border-color:var(--accent);color:var(--text)}button:active,.btn:active{transform:scale(.98)}button.primary,.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.tabs a,.room-link.selected,.room-icon,.tag,.profile-chips span,.profile-chips.interests span,.avatar,#identity .avatar,.result-metrics>div{background:var(--tint);color:var(--text)}
.tabs a[aria-current=page]{background:var(--accent);color:var(--accent-ink)}
.message-row .message{background:var(--surface);border-color:var(--line);color:var(--text)}.message-row.own .message{background:var(--tint);border-color:var(--line)}
.messages,.public-conversation .messages{background-color:var(--surface-alt);background-image:var(--wall-image);background-size:var(--wall-size,auto)}
.public-conversation .message-row{background:color-mix(in srgb,var(--surface) 92%,transparent);border-color:var(--line)}
.public-conversation .message-row.own{background:color-mix(in srgb,var(--tint) 92%,transparent);box-shadow:inset 3px 0 var(--accent)}
.public-conversation .message-row .message,.public-conversation .message-row.own .message{background:transparent;border:0}
.day-divider,.public-conversation .day-divider{background:var(--surface-alt);color:var(--muted);border-color:var(--line)}
.emoji-picker,.emoji-picker button,.emoji-categories button,.emoji-grid button{background:var(--surface);color:var(--text);border-color:var(--line)}.emoji-categories button[aria-pressed=true]{background:var(--tint);color:var(--text)}
#status{background:var(--text);color:var(--surface)}.you{color:var(--muted);border-color:var(--line)}
.profile-sections{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;max-width:1040px;overflow:visible;padding:0;margin:0 auto 18px;white-space:normal}.profile-sections button{min-width:0;min-height:46px;border:1px solid var(--line);background:var(--surface);color:var(--muted);padding:10px 8px;font-size:13px;line-height:1.35;font-weight:600;white-space:normal;overflow-wrap:anywhere}.profile-sections button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.profile-pane[hidden]{display:none!important}.profile-pane{max-width:1040px;margin:auto}.profile-pane>.card{margin:16px 0}.profile-pane .profile-overview{margin:0}.profile-edit-shortcut{margin:12px 0 0}.profile-pane .profile-editor{min-width:0}.profile-pane .profile-info{align-self:start}.profile-pane .profile-intro{min-width:0}.profile-pane .profile-bio{overflow-wrap:anywhere}
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:22px 0}.theme-options button{padding:10px;display:flex;flex-direction:column;align-items:start;gap:10px;font-size:14px;text-align:left}.theme-options button[aria-pressed=true],.wall-options button[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:2px}.theme-swatch{height:88px;width:100%;border-radius:9px;display:block;border:1px solid #8883}.swatch-light{background:linear-gradient(140deg,#fff 55%,#eee9fa 55%)}.swatch-dark{background:linear-gradient(140deg,#1a1e27 55%,#baa5ff 55%)}.swatch-cyber{background:linear-gradient(140deg,#111b2d 55%,#53edeb 55%)}.swatch-forest{background:linear-gradient(140deg,#1b251b 55%,#b8d777 55%)}.swatch-rose{background:linear-gradient(140deg,#fff0f5 55%,#b93676 55%)}.swatch-ocean{background:linear-gradient(140deg,#edf7fa 55%,#13788b 55%)}.wall-options{display:flex;flex-wrap:wrap;gap:10px}
.touch-photo-viewer{width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;border:0!important;border-radius:0!important;padding:0!important;background:#090b10!important;color:#fff;overflow:hidden}
.touch-photo-viewer::backdrop{background:#090b10}.touch-photo-viewer img{width:100%;max-width:100%!important;height:100%;max-height:100%!important;object-fit:contain;touch-action:pan-y pinch-zoom}.touch-photo-viewer .photo-toolbar{position:absolute;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top)) 16px 12px;background:linear-gradient(#0008,transparent);z-index:2}.touch-photo-viewer button{background:#252833c9;color:#fff;border:1px solid #ffffff29;border-radius:24px;min-width:44px}.touch-photo-viewer .photo-controls{position:absolute;bottom:calc(20px + env(safe-area-inset-bottom));left:0;right:0;display:flex;justify-content:center;gap:18px}.touch-photo-viewer .photo-position{font-size:14px}.touch-photo-viewer .photo-dismiss{font-size:26px;line-height:1;padding:6px}
@media(max-width:700px){.profile-sections{grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 16px;padding:0}.profile-sections button{padding:10px 6px}.theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}.theme-swatch{height:72px}.profile-pane .profile-overview{padding:0;overflow:hidden}.profile-pane .profile-photo{border-radius:0;max-height:48dvh}.profile-pane .profile-intro{padding:18px}.profile-pane .profile-intro h2{font-size:27px}.profile-pane .profile-bio{font-size:15px;line-height:1.6;margin:12px 0}.profile-pane .profile-info p{font-size:14px}.profile-pane .profile-fields{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){button,.btn{transition:none}html{scroll-behavior:auto}}

.composer-media-tabs{display:flex;gap:8px;width:100%;border-bottom:1px solid var(--line);padding-bottom:8px}.composer-media-tabs button{font-size:14px;padding:7px 16px;background:transparent;color:var(--muted)}.composer-media-tabs button[aria-pressed=true]{background:var(--tint);color:var(--text)}.sticker-browser{width:100%;min-width:0}.sticker-browser .sticker-heading{margin:8px 0}.sticker-browser .sticker-heading a{color:var(--accent);font-size:13px}.emoji-picker:has(.sticker-browser){max-height:min(48dvh,440px);overflow:auto}.sticker-pack-tabs button[aria-pressed=true]{color:var(--accent-ink)}.sticker-browser .sticker-pick-grid{max-height:220px}.chat-sticker{filter:drop-shadow(0 4px 5px #0000000a)}

.sticker-source-note{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);padding:12px 4px}.sticker-source-note a{color:var(--accent)}.sticker-unavailable{display:inline-block;padding:12px;border:1px dashed var(--line);border-radius:10px;font-size:13px;color:var(--muted)}

.sticker-browser .sticker-pack-tabs button{font-size:14px;padding:8px 12px}.draft-stickers{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.draft-sticker{position:relative;display:inline-flex}.message-draft .chat-sticker{width:64px;height:64px}.draft-sticker button{position:absolute;right:-4px;top:0;min-height:24px;width:24px;padding:0;border-radius:50%;background:var(--surface-alt);font-size:16px}.message-draft{max-height:100px}

body:has(.chat) main>.chat-tabs a{background:var(--tint);color:var(--text)}body:has(.chat) main>.chat-tabs a[aria-current=page]{background:var(--accent);color:var(--accent-ink)}.compose input{background:var(--surface-alt);color:var(--text);border-color:var(--line)}.compose input::placeholder{color:var(--muted)}.message-row .avatar{background:var(--tint);color:var(--text)}.message-author .you{background:var(--surface-alt);color:var(--muted)}.public-conversation .message-row{border-color:var(--line)}.error{color:#b32950}:root[data-theme=dark] .error,:root[data-theme=cyber] .error,:root[data-theme=forest] .error{color:#ff9db5}

.public-conversation .message-row.own{border-color:var(--line)}.public-conversation .message-row.own .avatar{background:var(--surface-alt)}

.app-sticker-content>.sticker-pick-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.messages>.message-row,.messages>.day-divider{flex-shrink:0}.message-row .message{align-self:flex-start}

.brand .brand-image{object-fit:cover;padding:0;background:#030b22;box-shadow:0 3px 12px #33297b1a}

@media (min-width:701px) and (max-width:1000px){.profile-sections{grid-template-columns:repeat(3,minmax(0,1fr))}}
