/* Shared app/web visual language. Functional media and map rules remain in styles.css. */
:root {
  --primary: #075e50; --accent: #0a6b5d; --soft: #e3f2eb;
  --bg: #f5f6f8; --surface: #fff; --alt: #f0f2f5;
  --ink: #20242c; --muted: #626d7c; --line: #e2e5eb;
  --shadow: 0 4px 24px #183c2905; --focus: #0a8065;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-theme=dark] {
  --primary: #91dec0; --accent: #abe9d1; --soft: #234438;
  --bg: #111318; --surface: #1b1e24; --alt: #272b33;
  --ink: #f3f4f7; --muted: #c1c7d0; --line: #363c47;
  --shadow: 0 4px 24px #0000000a; --focus: #91dec0;
}
body { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1 { font-size: clamp(28px, 2.7vw, 36px); letter-spacing: -1.15px; line-height: 1.15; }
h2 { font-size: 19px; letter-spacing: -.35px; }
small { font-size: 12px; line-height: 1.5; }
.btn { min-height: 48px; border-radius: 14px; font-weight: 650; padding: 12px 20px; }
.btn.small { min-height: 44px; padding: 10px 15px; }
/* styles.css darkens all dark-mode button text for filled buttons; tonal buttons need light text. */
[data-theme=dark] .btn.secondary { color: var(--primary); }
[data-theme=dark] .btn.quiet { color: var(--ink); }
.btn.secondary:hover, .btn.quiet:hover { background: var(--line); color: var(--ink); }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; }
.card { border-radius: 18px; padding: 24px; box-shadow: none; }
.avatar { box-shadow: none; width: 44px; height: 44px; }
.avatar.large { width: 100px; height: 100px; }
.pill { background: var(--soft); color: var(--primary); font-size: 11px; letter-spacing: .2px; }
.eyebrow { color: var(--primary); letter-spacing: 1.4px; }
label { font-size: 13px; line-height: 1.5; gap: 8px; }
input, select, textarea { min-height: 50px; border-radius: 14px; padding: 12px 15px; font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--focus); }
input[type=file] { font-size: 13px; background: var(--bg); border-style: dashed; padding: 14px; }
input[type=file]::file-selector-button { border: 0; border-radius: 8px; padding: 8px 10px; margin-right: 10px; background: var(--soft); color: var(--primary); font-weight: 600; cursor: pointer; }
.password-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.password-field input { border: 0; background: transparent; flex: 1; min-width: 0; outline: none; }
.password-field:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.password-toggle { display: inline-grid; place-items: center; flex-shrink: 0; width: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 12px; color: var(--muted); }
.password-toggle:hover, .password-toggle[aria-pressed=true] { color: var(--primary); }
.password-toggle .icon { width: 20px; height: 20px; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.error { background: #fff0f0; color: #a52222; border: 1px solid #f3c9c9; padding: 14px 16px; border-radius: 14px; }
[data-theme=dark] .error { background: #3d2224; color: #ffb9b9; border-color: #6d3a3d; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 14px 20px; border-radius: 12px; background: var(--primary); color: var(--surface); }
.skip-link:focus { top: 14px; }
.shell { max-width: 1600px; grid-template-columns: 248px minmax(0, 1fr); border: 0; }
.sidebar { padding: 32px 20px 20px; gap: 28px; border-right: 1px solid var(--line); }
.sidebar .brand { font-size: 21px; letter-spacing: -.9px; padding: 0 9px; }
.sidebar .brand img { width: 34px; height: 34px; }
.nav-label { display: block; margin: 0 14px 10px; font-size: 10px; font-weight: 750; letter-spacing: 1.6px; color: var(--muted); }
.nav { gap: 4px; }
.nav a { min-height: 48px; padding: 12px 15px; gap: 13px; border-radius: 13px; font-size: 14px; font-weight: 550; }
.nav a.active { box-shadow: none; }
.sidebar > .btn { margin: 0 4px; box-shadow: 0 5px 15px #075e5014; }
.account { padding: 18px 4px 0; gap: 10px; }
.account .avatar { width: 36px; height: 36px; font-size: 13px; }
.account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.account .icon-btn { width: 44px; min-width: 44px; }
.topbar { height: 80px; padding: 0 36px; gap: 24px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 14px; font-weight: 650; }
.breadcrumb:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.topbar-search { display: flex; gap: 8px; align-items: center; width: min(340px, 38vw); margin-left: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; }
.topbar-search input { min-height: 42px; border: 0; background: transparent; padding: 10px 0; font-size: 13px; }
.topbar-search .icon { color: var(--muted); width: 18px; }
.topbar-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.topbar-search input:focus { outline: none; }
.topbar .row { gap: 8px; }
.topbar .row > a:last-child { margin-left: 4px; }
.topbar .avatar { width: 36px; height: 36px; font-size: 13px; }
.mobile-create { display: none; }
.content { padding: 34px 36px 48px; max-width: 1240px; }
.page-head { margin-bottom: 28px; align-items: flex-start; }
.page-head h1 { margin: 0 0 8px; }
.page-head p { max-width: 520px; line-height: 1.65; }
.page-head .eyebrow { display: block; margin-bottom: 10px; font-size: 10px; }
.columns { grid-template-columns: minmax(0, 1fr) 276px; gap: 28px; }
.stack { gap: 20px; }
.rail { top: 108px; gap: 20px; }
.rail .card { padding: 24px; }
.rail h2 { margin-bottom: 10px; font-size: 16px; }
.topic { padding: 16px 0; }
.topic strong { font-weight: 650; }
.community-card { background: var(--soft); border-color: transparent; box-shadow: none; }
.community-card .feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--primary); background: var(--surface); margin-bottom: 22px; }
.community-card .btn { margin-top: 12px; background: var(--surface); }
.composer { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; padding: 20px; }
.composer > button { min-height: 48px; border: 0; border-radius: 14px; font-size: 14px; padding: 12px 16px; }
.composer-actions { grid-column: 1/-1; display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.composer-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; font-size: 13px; padding: 8px 12px; min-height: 44px; color: var(--muted); border: 0; border-radius: 12px; }
.composer-actions .icon { width: 19px; color: var(--primary); }
.post { padding: 0; }
.post-head { padding: 22px 24px 12px; }
.post-head strong { font-size: 15px; }
.post-content { font-size: 15px; padding: 8px 24px 20px; line-height: 1.75; }
.post-stats { padding: 16px 24px 10px; }
.post-actions { margin: 0 16px; padding: 6px 0; }
.post-actions button { min-height: 48px; border-radius: 12px; }
.media-grid.single { margin: 0 12px; border-radius: 14px; overflow: hidden; }
.comments { padding: 20px 24px; gap: 18px; }
.comment-body { border-radius: 4px 16px 16px; padding: 12px 16px; }
.tabs { gap: 6px; padding: 5px; margin-bottom: 24px; background: var(--alt); border-radius: 16px; width: fit-content; max-width: 100%; }
.tabs button { min-height: 44px; border-radius: 12px; padding: 10px 20px; font-size: 13px; font-weight: 600; }
.tabs button.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px #15271d0a; }
.people { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.person { align-items: flex-start; text-align: left; gap: 18px; }
.person .avatar { width: 64px; height: 64px; border-radius: 22px; }
.person .row { justify-content: flex-start; width: 100%; padding-top: 4px; }
.person h2 { font-size: 17px; }
.activity { min-height: 94px; padding: 22px 24px; gap: 18px; }
.activity .avatar { background: var(--alt); border-radius: 16px; }
.activity.unread .avatar { background: var(--surface); }
.activity.unread { box-shadow: inset 3px 0 var(--primary); }
.profile-cover { height: 160px; background: #075e50; background-image: radial-gradient(ellipse at 85% 120%, #6aa78b80, transparent 65%); }
.profile-cover:after { width: 260px; height: 260px; top: -110px; right: 45px; }
.profile-body { padding: 0 28px 28px; }
.profile-body > .avatar { margin-top: -50px; border: 5px solid var(--surface); box-sizing: content-box; }
.profile-body h1 { font-size: 28px; margin-top: 16px; }
.stats { gap: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.stats strong { font-size: 26px; letter-spacing: -.8px; }
.stats small { font-size: 12px; }
.settings-grid { gap: 22px; align-items: start; }
.settings-grid h2 { display: flex; gap: 12px; align-items: center; font-size: 18px; margin-bottom: 22px; }
.settings-grid h2 .icon { color: var(--primary); }
.settings-grid section > p { font-size: 14px; }
.table-wrap { border: 1px solid var(--line); border-radius: 16px; }
table { font-size: 14px; }
th { background: var(--bg); font-size: 11px; padding: 16px; }
td { padding: 16px; }
tbody tr:last-child td { border: 0; }
tbody tr:hover { background: var(--bg); }
.status-label { display: inline-flex; padding: 5px 10px; border-radius: 8px; font-size: 12px; background: var(--soft); color: var(--primary); }
.status-label.locked { background: var(--orange-soft); color: var(--orange-ink); }
[data-page=messages] .content, [data-page=ai] .content { max-width: none; }
[data-page=messages] .page-head h1, [data-page=ai] .page-head h1 { font-size: 30px; }
.chat-layout { grid-template-columns: 280px minmax(0,1fr); height: calc(100dvh - 238px); min-height: 450px; border-radius: 22px; box-shadow: var(--shadow); }
.contacts { padding: 10px; background: var(--surface); }
.contacts-label { padding: 12px 14px 8px; font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.contact { border: 0; border-radius: 14px; padding: 14px 12px; margin-bottom: 4px; gap: 12px; min-height: 76px; }
.contact strong { font-size: 14px; }
.contact small { font-size: 12px; max-width: 165px; }
.contact .avatar { width: 42px; height: 42px; }
.contact.active { box-shadow: none; }
.chat-header { min-height: 80px; padding: 16px 20px; }
.chat-header .grow > small { display: block; font-size: 12px; font-weight: 400; margin-top: 2px; }
.messages { background: var(--bg); padding: 24px; gap: 14px; overscroll-behavior: contain; }
.bubble { border: 1px solid var(--line); background: var(--surface); border-radius: 18px 18px 18px 5px; padding: 12px 16px; max-width: 82%; font-size: 14px; line-height: 1.6; }
.bubble.own { background: #075e50; border-color: #075e50; color: #fff; border-radius: 18px 18px 5px 18px; }
[data-theme=dark] .bubble.own { background: #397961; border-color: #397961; color: #fff; }
.bubble small { font-size: 11px; opacity: .85; margin-top: 6px; }
.bubble.is-call, .bubble.is-sticker { border: 0; }
.bubble.is-sticker.own { background: transparent; color: var(--ink); }
.chat-compose { padding: 16px; gap: 7px; }
.chat-compose input { min-height: 48px; border-radius: 18px; font-size: 15px; background: var(--bg); border: 1px solid var(--line); }
.chat-compose > .btn { border-radius: 16px; width: 48px; min-width: 48px; }
.chat-compose .icon-btn { border-radius: 12px; }
.ai-disclosure { padding: 10px 20px; font-size: 12px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.ai-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 12px 16px; }
.ai-starters button { min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--primary); }
.pending-message { align-self: flex-start; padding: 12px 16px; border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 13px; }
.sticker-tray { border-radius: 18px 18px 0 0; background: var(--bg); }
.sticker-grid button { border-radius: 14px; }
.map-card { padding: 0; }
.map-search, .map-results { border: 1px solid var(--line); box-shadow: 0 8px 28px #15271d14; border-radius: 16px; }
.map-locate { border: 1px solid var(--line); box-shadow: 0 8px 28px #15271d14; }
.map-saved { padding: 24px; }
.place { padding: 16px; border-radius: 14px; background: var(--bg); }
dialog { border-radius: 24px; padding: 28px; box-shadow: 0 24px 100px #13271e33; }
dialog::backdrop { background: #101f1980; backdrop-filter: blur(6px); }
.modal-head h2 { font-size: 23px; }
.empty { padding: 54px 24px; }
.empty > .icon { width: 48px; height: 48px; padding: 12px; box-sizing: content-box; border-radius: 22px; background: var(--soft); margin-bottom: 18px; }
.empty h2 { font-size: 20px; }
.empty p { font-size: 14px; line-height: 1.7; }
.boot { font-size: 14px; padding: 64px 20px; }
.boot:before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 16px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; }
.button-spinner { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; }
#toast { border-radius: 14px; padding: 15px 22px; line-height: 1.5; font-size: 14px; }
/* Login explains value before asking for credentials. No imitation social-login button. */
.auth { padding: 24px; gap: 24px; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); background: var(--surface); }
.auth-story { padding: clamp(28px,4vw,64px); gap: 36px; border-radius: 30px; background: #073f35; color: #fff; position: relative; }
.auth-story .brand, [data-theme=dark] .auth-story .brand { color: #fff; font-size: 23px; }
.auth-story .brand img { border-radius: 12px; }
.auth-story h1 { font-size: clamp(42px,4.8vw,68px); max-width: 600px; letter-spacing: -2.8px; margin: 20px 0; }
.auth-story p, [data-theme=dark] .auth-story p { color: #bed8ca; font-size: 16px; line-height: 1.8; max-width: 370px; }
.auth-story .eyebrow { color: #a9d4ba; font-size: 10px; }
.auth-story > small { color: #a9c8b8; font-size: 12px; }
.auth-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 36px; }
.auth-feature { border: 1px solid #ffffff24; background: #ffffff08; border-radius: 18px; padding: 18px 14px; }
.auth-feature .icon { display: block; width: 23px; height: 23px; margin-bottom: 18px; color: #b8e4ca; }
.auth-feature strong { font-size: 12px; font-weight: 550; }
.auth-form { padding: 40px 24px; }
.auth-box { max-width: 410px; }
.auth-box > h1 { font-size: 32px; margin-bottom: 10px; }
.auth-box > p { line-height: 1.7; margin-bottom: 30px; font-size: 14px; }
.auth-box form { gap: 20px; }
.auth-box form > .btn { min-height: 52px; margin-top: 4px; }
.auth-box .password-toggle { width: 48px; }
.auth-links a { padding: 8px 0; min-height: 40px; display: inline-flex; align-items: center; }
.auth-foot { padding-top: 24px; margin-top: 22px; border-top: 1px solid var(--line); }
.auth-foot a { font-weight: 650; }
.auth-note { margin-top: 26px; font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; }
.auth-mobile-value { display: none; }
.auth-step { display: block; margin: 0 0 14px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--primary); text-transform: uppercase; }
.video-call { border-radius: 28px; }
.call-controls .call-icon { width: 52px; height: 52px; min-width: 52px; }
.call-stage { border-radius: 22px; }
.call-stage-avatar { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: #101a18; }
.call-stage-avatar[hidden] { display: none; }
.call-stage-avatar .call-avatar { width: clamp(112px, 14vw, 184px); height: clamp(112px, 14vw, 184px); font-size: 52px; background: #24483c; color: #b4efd5; }
.call-stage-avatar .call-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.call-stage .local { z-index: 2; }
.call-sound-notice { line-height: 1.7; }
body[data-native-call=true] .video-call { border-radius: 0; }
@media (min-width: 1500px) { .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
@media (max-width: 1200px) {
  .shell { grid-template-columns: 216px minmax(0,1fr); }
  .sidebar { padding: 28px 14px 20px; }
  .content { padding: 28px; }
  .topbar { padding: 0 28px; gap: 16px; }
  .columns { grid-template-columns: minmax(0,1fr); }
  .rail { display: none; }
  .chat-layout { grid-template-columns: 240px minmax(0,1fr); }
  .chat-compose { padding: 12px; gap: 3px; }
  .chat-compose .icon-btn { width: 40px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .topbar-search { width: 200px; }
  .breadcrumb { display: none; }
  .chat-layout { grid-template-columns: 200px minmax(0,1fr); }
  .chat-compose { flex-wrap: wrap; }
  .chat-compose input[name=content] { order: -1; width: 100%; flex-basis: 100%; }
  .auth { grid-template-columns: .9fr 1fr; padding: 16px; }
  .auth-story { padding: 32px; }
  .auth-features { grid-template-columns: 1fr; }
  .auth-feature { display: flex; align-items: center; gap: 12px; padding: 12px; }
  .auth-feature .icon { margin: 0; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar, .topbar-search, .breadcrumb { display: none; }
  .topbar { height: 68px; padding: 0 18px; gap: 8px; }
  .topbar .mobile-brand { display: flex; font-size: 20px; }
  .topbar .mobile-brand img { width: 32px; height: 32px; }
  .topbar .row > .icon-btn:first-child { display: inline-flex; }
  .topbar .row > a[href="#messages"], .topbar .row > a[href="#activity"] { display: none; }
  .topbar .row { gap: 2px; }
  .topbar .avatar { width: 32px; height: 32px; }
  .mobile-create { display: inline-flex; color: var(--primary); }
  .content { padding: 24px 16px calc(100px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 22px; gap: 12px; }
  .page-head h1 { font-size: 29px; letter-spacing: -.9px; }
  .page-head p { font-size: 13px; }
  .page-head .eyebrow { display: none; }
  .card { border-radius: 20px; padding: 20px; }
  .post { padding: 0; }
  .post-head { padding: 18px 18px 10px; }
  .post-content { padding: 8px 18px 18px; font-size: 14px; }
  .post-stats { padding: 14px 18px 8px; }
  .composer { padding: 16px; gap: 10px; }
  .composer > button { font-size: 13px; padding: 12px; }
  .composer-actions { gap: 4px; padding-top: 10px; }
  .composer-actions button { font-size: 12px; padding: 8px; }
  .mobile-nav { padding: 8px 6px max(8px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 22px #15271d08; z-index: 6; }
  .mobile-nav a { flex: 1; min-width: 0; min-height: 52px; padding: 7px 4px; border-radius: 13px; font-size: 10px; gap: 4px; }
  .mobile-nav .icon { width: 22px; height: 22px; }
  .mobile-nav a.active { background: var(--soft); }
  .tabs { width: 100%; flex-wrap: nowrap; overflow: auto; }
  .tabs button { flex: 1; padding: 10px 13px; white-space: nowrap; }
  .people { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .person { padding: 18px 14px; gap: 14px; }
  .person .avatar { width: 54px; height: 54px; border-radius: 18px; }
  .person .row { gap: 6px; }
  .person .btn { width: 100%; padding: 10px 8px; }
  .person h2 { font-size: 15px; overflow-wrap: anywhere; }
  .activity { padding: 18px 16px; gap: 12px; }
  .activity p { font-size: 13px; }
  .profile-hero { padding: 0; }
  .profile-cover { height: 130px; }
  .profile-body { padding: 0 20px 22px; }
  .profile-body .row { flex-wrap: wrap; gap: 16px; }
  .profile-body h1 { font-size: 25px; }
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  [data-page=messages] .content, [data-page=ai] .content { padding: 20px 12px 86px; }
  [data-page=messages] .page-head, [data-page=ai] .page-head { padding: 0 6px; margin-bottom: 18px; }
  [data-page=messages] .page-head p, [data-page=ai] .page-head p { display: none; }
  .chat-layout { grid-template-columns: 1fr; min-height: 350px; height: calc(100dvh - 230px - env(safe-area-inset-bottom)); border-radius: 20px; }
  .contacts { padding: 8px; }
  .chat-header { padding: 12px; min-height: 70px; gap: 8px; }
  .chat-header .icon-btn { width: 40px; height: 44px; }
  .chat-header .avatar { display: none; }
  .messages { padding: 18px 14px; }
  .bubble { max-width: 88%; padding: 11px 14px; }
  .chat-compose { padding: 10px 8px; gap: 3px; flex-wrap: wrap; }
  .chat-compose input[name=content] { order: -1; flex: 1 0 100%; width: 100%; margin-bottom: 4px; }
  .chat-compose > .btn { margin-left: auto; min-width: 44px; width: 44px; min-height: 44px; }
  .chat-compose .icon-btn { min-width: 44px; width: 44px; height: 44px; }
  .ai-disclosure { padding: 8px 14px; font-size: 11px; }
  .map-card { padding: 0; }
  .map-saved { padding: 20px; }
  .auth { display: block; padding: 0; }
  .auth-story { display: none; }
  .auth-form { min-height: 100dvh; padding: 32px 24px; align-items: flex-start; }
  .auth-logo { display: block; margin-bottom: 32px; }
  .auth-mobile-value { display: block; padding: 0 0 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
  .auth-mobile-value strong { display: block; color: var(--ink); font-size: 27px; line-height: 1.2; letter-spacing: -.8px; margin-bottom: 12px; }
  .auth-box > h1 { font-size: 24px; }
  .auth-box > p { margin-bottom: 24px; }
  .auth-links { gap: 6px; }
  dialog { padding: 22px; border-radius: 22px; width: calc(100% - 24px); }
  .video-call { padding: 18px; }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); }
}
@media (max-width: 370px) { .topbar .brand { font-size: 17px; } .topbar .row > a:last-child { display: none; } .tabs button { padding: 10px; } .people { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) {
  .boot:before, .button-spinner { animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Icon-only buttons: the old text is the aria-label and a hover/focus tooltip (data-tip). Min 44px targets. */
.btn.icon-only { width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; gap: 0; flex-shrink: 0; }
.btn.icon-only.small { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
.btn.icon-only .icon { width: 20px; height: 20px; }
.person .btn.icon-only { width: 44px; padding: 0; }
.post-actions { gap: 4px; }
.post-actions button.icon-only { flex: 0 0 auto; width: 48px; height: 48px; padding: 0; }
.post-actions button.icon-only .icon { width: 22px; height: 22px; }
.post-actions button.save { margin-left: auto; }
.post-actions button.icon-only:hover { color: var(--ink); }
.post-actions button.liked:hover { color: #dc3545; }
.post-actions button.selected:hover { color: var(--primary); }
.composer-actions button.icon-only { flex: 0 0 44px; width: 44px; padding: 0; }
.post-head [data-action=post-menu] .icon { stroke-width: 3; }
.password-toggle:focus-visible { outline-offset: -3px; }
.icon-actions { gap: 10px; }
#older-messages { align-self: center; margin-top: 10px; }
[data-tip] { position: relative; }
.map-locate[data-tip] { position: absolute; }
[data-tip]::after { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 60; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font: 600 12px/1.3 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; text-transform: none; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px #0000002e; }
[data-tip]:focus-visible::after { content: attr(data-tip); }
@media (hover: hover) { [data-tip]:hover::after { content: attr(data-tip); } }
[data-tip-pos^=bottom]::after { bottom: auto; top: calc(100% + 8px); }
[data-tip-pos$=end]::after { left: auto; right: 0; transform: none; }
[data-tip-pos$=start]::after { left: 0; transform: none; }

/* Social UI refresh: quieter surfaces, clear conversation authors, one composer action. */
.page-head .eyebrow { display: none; }
.post-content { line-height: 1.6; }
.post-head { padding-top: 18px; }
.composer > button { border-radius: 999px; text-align: left; }
.chat-ai-hint { margin: 0; padding: 8px 18px; font-size: 12px; color: var(--muted); background: var(--alt); border-top: 1px solid var(--line); }
.bubble.is-ai { align-self: flex-start; background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.ai-author { display: block; color: var(--primary); font-size: 12px; margin-bottom: 6px; }
.location-card { padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.location-card p { margin: 6px 0; font-size: 14px; }
.location-card strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.map-canvas { background: var(--alt); }
.map-saved { margin-bottom: 16px; }
.map-card > .location-card { margin: 0 16px 16px; }
.map-locate, .leaflet-control-zoom a { min-width: 44px; min-height: 44px; }
@media (max-width: 700px) {
  .card { border-radius: 16px; }
  .chat-ai-hint { padding: 8px 12px; }
  .mobile-nav a { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Feed and composer layout based on the supplied desktop reference. */
.feed-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body[data-page=home] .content { max-width: 1320px; padding-top: 24px; }
body[data-page=home] .columns { grid-template-columns: minmax(0, 1fr) 280px; gap: 36px; }
body[data-page=home] .columns > .stack { max-width: 790px; width: 100%; justify-self: center; }
body[data-page=home] .composer { grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; padding: 16px 18px 10px; }
body[data-page=home] .composer > .avatar { width: 48px; height: 48px; }
body[data-page=home] .composer > button { background: var(--alt); border: 0; min-height: 48px; font-size: 15px; }
body[data-page=home] .composer-actions { justify-content: space-around; padding-top: 8px; }
body[data-page=home] .composer-actions button { flex: 1; font-weight: 650; }
body[data-page=home] .composer-actions button:first-child .icon { color: #e54568; }
body[data-page=home] .composer-actions button:nth-child(2) .icon { color: #34a874; }
body[data-page=home] .composer-actions button:nth-child(3) .icon { color: #e49b2b; }
.feed-section-title { font-size: 14px; font-weight: 700; color: var(--muted); padding: 2px 4px 0; }
body[data-page=home] .post { border-radius: 14px; }
body[data-page=home] .post-head { padding: 16px 18px 10px; }
body[data-page=home] .post-content { padding: 9px 18px 18px; font-size: 16px; }
body[data-page=home] .media-grid.single { margin: 0; border-radius: 0; }
body[data-page=home] .media-grid.single img, body[data-page=home] .media-grid.single video { max-height: 650px; }

dialog:has(.compose-workspace) { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--bg); overflow: hidden; }
dialog:has(.compose-workspace)::backdrop { background: var(--bg); backdrop-filter: none; }
dialog:has(.compose-workspace) #modal-content { height: 100%; display: grid; grid-template-rows: 70px minmax(0,1fr); }
dialog:has(.compose-workspace) .modal-head { margin: 0; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: row-reverse; justify-content: flex-end; gap: 20px; }
dialog:has(.compose-workspace) .modal-head h2 { font-size: 21px; }
dialog:has(.compose-workspace) .modal-head .icon-btn { border-radius: 50%; background: var(--alt); }
.compose-workspace { display: grid; grid-template-columns: minmax(360px, 40%) minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; min-height: 0; }
.compose-editor { padding: 24px; background: var(--surface); border-right: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.compose-author { gap: 12px; }
.compose-author small, .preview-post small { display: block; color: var(--muted); }
.compose-text { display: block; }
.compose-text textarea { width: 100%; min-height: 150px; resize: vertical; border-radius: 12px; background: var(--surface); font-size: 17px; }
.compose-upload { min-height: 150px; border: 2px dashed var(--line); border-radius: 16px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; cursor: pointer; }
.compose-upload:hover, .compose-upload:focus-within { border-color: var(--primary); background: var(--alt); }
.compose-upload .icon { width: 28px; height: 28px; color: var(--primary); }
.compose-upload small, .compose-limit { color: var(--muted); }
.compose-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; }
.compose-preview { min-width: 0; overflow: auto; padding: clamp(28px, 5vw, 70px); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.compose-preview h3 { margin: 0 0 12px; width: min(100%, 620px); font-size: 20px; }
.preview-post { width: min(100%, 620px); padding: 16px 0 0; border-radius: 16px; }
.preview-post > .row { padding: 0 18px; gap: 12px; }
.preview-post > p { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 18px; padding: 0 18px; font-size: 16px; }
.preview-post .file-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; max-height: 440px; overflow: auto; }
.preview-post .file-preview img, .preview-post .file-preview video { width: 100%; height: 240px; object-fit: cover; border-radius: 0; }
.preview-post .file-preview > :only-child { grid-column: 1/-1; height: auto; max-height: 440px; object-fit: contain; }
.preview-actions { display: flex; gap: 20px; padding: 14px 18px; color: var(--muted); }
.compose-footer { grid-column: 1/-1; display: flex; justify-content: flex-end; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.compose-footer .btn { min-width: 180px; }
.bubble.is-image { padding: 6px; max-width: min(85%, 420px); }
.chat-image-button { display: block; padding: 0; width: 100%; cursor: zoom-in; }
.chat-image-button img { display: block; max-width: 100%; max-height: 300px; object-fit: contain; border-radius: 9px; }
.chat-image-full { display: block; width: 100%; max-height: calc(88dvh - 110px); object-fit: contain; }
dialog.chat-image-modal { width: min(1100px, calc(100% - 28px)); }
.chat-file-button { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; overflow-wrap: anywhere; text-align: left; text-decoration: underline; }
.admin-report { margin-bottom: 24px; }
@media (max-width: 1200px) { body[data-page=home] .columns { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body[data-page=home] .content { padding: 12px 12px 100px; }
  body[data-page=home] .composer { padding: 12px; }
  body[data-page=home] .composer-actions button { font-size: 12px; }
  .compose-workspace { display: flex; flex-direction: column; overflow: auto; }
  .compose-editor { border-right: 0; overflow: visible; }
  .compose-preview { padding: 24px; overflow: visible; display: block; }
  .compose-preview h3, .preview-post { width: 100%; }
  .compose-footer { position: sticky; bottom: 0; margin-top: auto; }
  .compose-footer .btn { width: 100%; }
}
