/* MapleNet interface system. Loaded after feature styles so every screen shares
   the same type scale, controls, colors and responsive layout. Legacy --green
   names remain aliases for existing components; new styles use semantic tokens. */
:root,
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --surface-hover: #eaedf1;
  --text: #18212c;
  --muted: #596675;
  --line: #e0e4e9;
  --brand: #b63745;
  --brand-hover: #9f2c39;
  --brand-soft: #f9edef;
  --primary: #202a35;
  --on-primary: #ffffff;
  --active: #e9edf2;
  --accent: #e9edf2;
  --hero: #eef1f5;
  --focus: #b63745;
  --danger: #b52e3f;
  --bubble-own: #e6edf4;
  --shadow: 0 2px 8px #14203104;
  --menu-shadow: 0 12px 40px #1420311a;
  --sidebar-width: 248px;
  --green: var(--brand);
  --green-dark: var(--brand-hover);
  --red: var(--brand);
  --red-soft: var(--brand-soft);
  --scrollbar-thumb: #a75862;
  --scrollbar-track: var(--bg);
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #111315;
  --surface: #1a1d21;
  --surface-soft: #20242a;
  --surface-hover: #292e35;
  --text: #eef1f5;
  --muted: #a1aab6;
  --line: #2b3037;
  --brand: #ed7982;
  --brand-hover: #f4949b;
  --brand-soft: #302126;
  --primary: #edf0f4;
  --on-primary: #17202b;
  --active: #262c33;
  --accent: #303945;
  --hero: #222a34;
  --focus: #ed7982;
  --danger: #f08a94;
  --bubble-own: #2a394b;
  --shadow: none;
  --menu-shadow: 0 16px 40px #0005;
  --scrollbar-thumb: #97545d;
  color-scheme: dark;
}

/* Type and controls: 16px body, 14px controls, 13px supporting information. */
body { font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { letter-spacing: -.025em; font-weight: 650; line-height: 1.25; }
h1, .page-heading h1 { font-size: clamp(26px, 2.2vw, 32px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { line-height: 1.65; }
::selection { background: var(--brand-soft); color: var(--text); }
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
.icon { width: 22px; height: 22px; stroke-width: 1.8; }
.button, .button-small, .button-dark {
  min-height: 42px; padding: 10px 18px; gap: 8px; border-radius: 10px;
  background: var(--primary); color: var(--on-primary); border: 1px solid transparent;
  font-size: 14px; font-weight: 650; line-height: 1.4; box-shadow: none;
  transition: background .15s, border-color .15s;
}
.button:hover, .button-dark:hover { background: color-mix(in srgb, var(--primary) 88%, var(--bg)); transform: none; }
.button .icon { width: 18px; height: 18px; }
.button-secondary { background: transparent; border-color: var(--line); color: var(--text); }
.button-secondary:hover { background: var(--surface-hover); border-color: var(--muted); }
.button-danger { color: var(--danger); background: var(--brand-soft); border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.button-danger:hover { background: color-mix(in srgb, var(--brand-soft) 80%, var(--danger)); }
.button:disabled { opacity: .5; transform: none; }
.icon-button { width: 42px; height: 42px; padding: 0; border-radius: 50%; color: var(--muted); }
.icon-button:hover { background: var(--active); color: var(--text); }
.text-link, .auth-links, .form-footnote a { font-size: 14px; color: var(--text); font-weight: 550; }
.text-link:hover, .auth-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.eyebrow, .nav-label { font-size: 11px; letter-spacing: .12em; font-weight: 650; }
.quiet-badge, .relationship-badge, .friend-status { font-size: 13px; color: var(--muted); }
.card { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow); }
.form-note, .form-footnote, .pending-notice, .composer-status, .post-feedback,
.feed-explanation, .friend-policy-note, .friend-action-status, [data-stream-status] { font-size: 13px; line-height: 1.6; }
.flash-message { font-size: 14px; background: var(--surface); border-left-color: var(--brand); }
.form-errors { background: var(--brand-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); font-size: 14px; }
.form-errors strong { font-size: inherit; }
.avatar { width: 42px; height: 42px; font-size: 16px; color: var(--text); background: var(--accent); }

/* Persistent navigation and a compact, useful top bar. */
.sidebar { width: var(--sidebar-width); padding: 26px 18px 18px; background: var(--bg); border-right-color: var(--line); }
.brand { gap: 10px; margin: 0 0 38px; min-height: 40px; }
.brand-mark { width: 36px; height: 40px; background: none; color: var(--brand); border-radius: 0; }
.brand-mark .icon { width: 32px; height: 32px; }
.brand-name { font-size: 23px; letter-spacing: -.8px; font-weight: 750; }
.brand-dot { color: var(--brand); }
.sidebar:not(.sidebar-collapsed .sidebar) .sidebar-collapse { top: 30px; right: 10px; width: 30px; height: 30px; }
.sidebar-collapse .icon { width: 19px; height: 19px; }
.nav-label { margin: 0 12px 12px; color: var(--muted); }
.nav-list { gap: 4px; }
.nav-item { padding: 12px 14px; min-height: 50px; gap: 15px; border-radius: 12px; font-size: 16px; color: var(--muted); font-weight: 500; }
.nav-item .icon { width: 24px; height: 24px; }
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 650; }
.nav-item.active > .icon { color: var(--brand); }
.active-dot { display: none; }
.second-label { margin-top: 28px; }
.sidebar-bottom { padding-top: 28px; }
.sidebar-note { padding: 16px 12px; margin: 0 0 10px; border: 0; background: none; }
.sidebar-note > .icon { display: none; }
.sidebar-note strong { font-size: 13px; font-weight: 550; color: var(--muted); }
.sidebar-note p { font-size: 12px; margin: 4px 0 0; }
.sidebar-caption { display: none; }
.theme-toggle { font-size: 14px; padding: 12px 14px; }
.theme-toggle .icon { width: 22px; height: 22px; }
.toggle-track { width: 32px; height: 20px; padding: 4px; background: var(--line); }
.toggle-track:before { width: 12px; height: 12px; }
[data-theme=dark] .toggle-track:before { background: var(--text); }
.logout { font-size: 14px; }
.workspace { width: calc(100% - var(--sidebar-width)); }
.topbar { height: 76px; padding: 0 36px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.breadcrumb { font-size: 14px; gap: 12px; }
.breadcrumb strong { font-weight: 600; }
.header-actions { gap: 14px; }
.header-search { padding: 0 14px; min-width: 240px; height: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.header-search .icon { width: 19px; height: 19px; }
.header-search input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 14px; outline: none; padding: 0; }
.header-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 15%, transparent); }
.header-search input:focus-visible { outline: none; }
.header-search input::placeholder { color: var(--muted); opacity: 1; }
.mobile-search { display: none; }
.header-login, .account-name { font-size: 14px; }
.account-name { max-width: 125px; font-weight: 550; }
.avatar-menu summary { gap: 10px; }
.down-arrow { display: none; }
.header-divider { height: 28px; margin: 0 4px; }
.account-dropdown { top: 54px; min-width: 220px; border-radius: 14px; padding: 8px; box-shadow: var(--menu-shadow); }
.account-dropdown strong { font-size: 13px; color: var(--muted); padding: 10px 12px; }
.account-dropdown a, .account-dropdown button { font-size: 14px; padding: 11px 12px; border-radius: 8px; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-hover); }
.notification-badge { min-width: 20px; height: 20px; font-size: 12px; background: #bf414e; color: #fff; border: 2px solid var(--bg); }
.notification-link .notification-badge { top: 1px; right: 0; }
.main { max-width: 1400px; padding: 32px 36px 24px; }
.page-heading { margin-bottom: 28px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.page-footer { font-size: 12px; gap: 20px; padding-top: 24px; margin-top: 36px; }
.page-footer .icon { width: 16px; height: 16px; }
.sidebar-collapsed { --sidebar-width: 88px; }
.sidebar-collapsed .sidebar { padding: 26px 12px 18px; }
.sidebar-collapsed .brand { margin: 0 auto 22px; }
.sidebar-collapsed .nav-item { padding: 14px; }

/* Home: content first, with no promotional red banner. */
.content-grid { grid-template-columns: minmax(0, 1fr) 296px; align-items: start; gap: 28px; }
.social-welcome { background: none; color: var(--text); padding: 0 2px; border-radius: 0; margin: 0 0 24px; min-height: 0; }
.social-welcome h2 { color: var(--text); font-size: 30px; margin: 0 0 6px; letter-spacing: -.03em; }
.social-welcome p { color: var(--muted); font-size: 15px; margin: 0; max-width: none; line-height: 1.55; }
.social-welcome .button { margin-top: 20px; background: var(--primary); color: var(--on-primary); }
.welcome-content { max-width: 100%; }
.post-composer { padding: 24px; margin-bottom: 26px; border-radius: 24px; transition: border-color .22s ease, box-shadow .22s ease; }
.post-composer:focus-within { border-color: color-mix(in srgb,var(--muted) 45%,var(--line)); box-shadow: 0 8px 32px #0000000a; }
.composer-input-row { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: start; gap: 14px; }
.composer-input-field { min-width: 0; }
.composer-heading { gap: 12px; margin: 0; padding-top: 2px; }
.composer-heading h2 { font-size: 16px; margin: 0 0 4px; }
.composer-heading p { font-size: 13px; }
.post-composer textarea { min-height: 108px; padding: 14px 16px; background: var(--surface-soft); border: 1px solid var(--line); font-size: 17px; border-radius: 18px; line-height: 1.55; transition: border-color .2s ease, background .2s ease; }
.post-composer textarea:hover { border-color: color-mix(in srgb,var(--muted) 40%,var(--line)); }
.post-composer textarea:focus { border-color: var(--focus); background: color-mix(in srgb,var(--surface-soft) 85%,var(--surface)); }
.post-composer textarea::placeholder { color: var(--muted); opacity: 1; }
.composer-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 16px; min-width: 0; flex-wrap: wrap; }
.composer-meta { display: contents; font-size: 12px; }
.composer-toolbar .emoji-picker { order: 0; }
.composer-toolbar .composer-media-controls { order: 1; margin: 0; }
.composer-toolbar output { order: 2; margin-left: auto; color: var(--muted); font-size: 12px; }
.composer-toolbar .composer-media-controls > span { display: none; }
.composer-media-controls .composer-attachment-label { font-size: 13px; }
.post-composer .emoji-picker { gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--line); }
.post-composer .emoji-picker button { display: grid; place-items: center; width: 34px; height: 34px; padding: 4px; font-size: 19px; border-radius: 50%; transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s ease, box-shadow .2s ease; }
.post-composer .emoji-picker button:hover { background: var(--surface); box-shadow: 0 3px 10px #00000018; }
.composer-media-controls { gap: 12px; margin: 10px 0; }
.composer-media-controls label { font-size: 13px; min-height: 42px; padding: 9px 15px; border-radius: 999px; background: var(--surface-soft); transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.composer-media-controls label:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.composer-media-controls label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.composer-media-controls label .icon { width: 18px; height: 18px; }
.composer-media-controls > span { font-size: 12px; }
.composer-submit { gap: 12px; padding-top: 20px; margin-top: 20px; }
.composer-submit .button { font-size: 14px; min-height: 44px; padding: 10px 18px; border-radius: 999px; transition: transform .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease; }
.composer-submit .button > .icon { transition: transform .2s ease; }
[data-publish-post] { background: #b63745; color: #fff; }
[data-publish-post]:hover { background: #a22e3c; }
.composer-visibility { border: 1px solid var(--line); background: var(--surface-soft); padding: 4px; gap: 3px; border-radius: 999px; }
.composer-visibility span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; font-size: 13px; border-radius: 999px; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.composer-visibility .icon { width: 16px; height: 16px; }
.composer-visibility label:hover span { background: var(--surface-hover); color: var(--text); }
.composer-visibility input:checked + span, .composer-visibility input:checked + span:hover { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px #0000001a; }
.composer-visibility input:focus-visible + span { border-radius: 999px; }
.composer-storage-note { display: flex; align-items: center; gap: 9px; margin: 16px 0 0; padding: 11px 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.composer-storage-note .icon { width: 17px; height: 17px; flex-shrink: 0; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .post-composer .emoji-picker button:hover { transform: translateY(-3px) scale(1.12); }
  .composer-media-controls label:not(:has(input:disabled)):hover,
  .composer-submit .button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 5px 14px #00000020; }
  .composer-submit [data-publish-post]:not(:disabled):hover > .icon { transform: translateX(3px); }
  .post-composer .emoji-picker button:active,
  .composer-submit .button:not(:disabled):active { transform: translateY(0) scale(.97); }
}
.composer-status:empty { display: none; }
.composer-attachments:empty { display: none; }
.post-preview > .button[data-close-preview] { margin-top: 20px; }
.feed-heading { margin: 24px 0 16px; padding: 0 2px; }
.feed-heading h2 { font-size: 18px; }
.feed-sorts { border: 0; background: var(--surface-soft); border-radius: 10px; padding: 4px; }
.feed-sorts a { padding: 8px 13px; font-size: 13px; font-weight: 550; }
.feed-sorts [aria-current=page] { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px #0001; }
.post-stream { padding: 0 8px 0 0; scrollbar-gutter: stable; max-height: clamp(380px, 76vh, 850px); }
.social-feed, .search-results, .post-stream [data-stream-items], .profile-post-list { gap: 16px; }
.social-post { padding: 22px 24px 12px; border-radius: 14px; box-shadow: none; }
.post-header { gap: 12px; margin-bottom: 15px; align-items: center; }
.post-author strong { font-size: 15px; font-weight: 650; }
.post-author p, .post-author p time { font-size: 13px; line-height: 1.5; }
.post-audience { font-size: 12px; }
.post-menu summary { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); padding: 6px; }
.post-menu summary .icon { width: 22px; height: 22px; }
.post-menu summary:hover { background: var(--surface-hover); color: var(--text); }
.post-menu > div { top: 40px; border-radius: 12px; padding: 6px; min-width: 210px; box-shadow: var(--menu-shadow); }
.post-menu a, .post-menu button { font-size: 14px; padding: 11px 12px; border-radius: 8px; }
.social-post-body { font-size: 16px; line-height: 1.65; padding: 0 0 18px; }
.post-gallery { gap: 5px; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.post-gallery img, .post-gallery video { border-radius: 0; }
.post-actions { border-top-color: var(--line); padding: 8px 0 0; gap: 8px; flex-wrap: nowrap; }
.post-actions button, .post-actions a { min-height: 40px; padding: 6px 8px; gap: 8px; font-size: 13px; border-radius: 8px; }
.post-actions .icon { width: 20px; height: 20px; }
.post-actions button:hover, .post-actions a:hover { background: var(--surface-soft); color: var(--text); }
.post-actions [aria-pressed=true] { color: var(--brand); }
.post-actions [aria-pressed=true] .icon { fill: var(--brand-soft); }
.post-actions button > span:first-child { font-size: inherit; }
.right-rail { gap: 20px; padding-top: 0; }
.right-rail .settings-card, .profile-side .settings-card { padding: 24px; }
.right-rail h2, .profile-side h2 { font-size: 17px; margin-bottom: 14px; }
.right-rail p, .profile-side p, .settings-card > .muted { font-size: 14px; line-height: 1.65; }
.trending-highlights-heading .quiet-badge { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 11px; }
.trending-highlight { gap: 12px; padding: 18px 0; }
.trending-highlight-rank { background: var(--surface-soft); color: var(--muted); font-size: 13px; width: 26px; height: 26px; }
.trending-highlight-content { gap: 6px; }
.trending-highlight-content strong { font-size: 13px; }
.trending-highlight-excerpt { font-size: 14px; line-height: 1.5; -webkit-line-clamp: 2; }
.trending-highlight-meta, .trending-highlight-content time { font-size: 12px; }
.trending-highlights > .text-link { font-size: 13px; }
.feed-empty { padding: 48px 24px; }
.feed-empty h3 { font-size: 20px; }
.feed-empty > p { font-size: 14px; }
.empty-illustration { background: var(--surface-soft); transform: none; }
.empty-illustration > .icon { color: var(--muted); }
.join-feed { padding: 24px; font-size: 15px; margin-bottom: 24px; }
.join-feed .text-link { font-size: 14px; }

/* Forms, settings and account screens. */
.auth-grid { max-width: 1060px; margin: 20px auto; gap: 32px; grid-template-columns: 1fr 1fr; }
.auth-card { padding: 36px; }
.auth-card h2 { font-size: 26px; max-width: none; }
.auth-card > .muted, .auth-form label, .auth-form .checkbox-label { font-size: 14px; }
.auth-form input { min-height: 48px; padding: 12px 14px; font-size: 16px; border-radius: 10px; background: var(--surface-soft); }
.auth-form small { font-size: 13px; line-height: 1.5; }
.auth-form .checkbox-label input { min-height: 0; width: 18px; height: 18px; accent-color: var(--brand); }
.auth-links { font-size: 13px; gap: 18px; }
.auth-message { background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: 40px; min-height: 480px; border-radius: 20px; }
.auth-message h2 { font-size: clamp(30px, 3vw, 42px); line-height: 1.2; margin-top: 40px; }
.auth-message > .eyebrow, .auth-message > p { color: var(--muted); }
.auth-message > p { font-size: 16px; max-width: 290px; }
.auth-leaf { color: var(--brand); opacity: .45; }
.form-icon { color: var(--muted); }
.settings-grid { gap: 24px; }
.account-settings + .settings-card { margin-top: 24px; }
.settings-card { padding: 28px; }
.settings-card h2 { font-size: 21px; }
.theme-option span { font-size: 14px; padding: 24px 12px; }
.theme-option input:checked + span { background: var(--active); color: var(--text); border-color: var(--muted); }
.theme-option .icon { width: 24px; height: 24px; }
.account-info { font-size: 14px; grid-template-columns: 110px minmax(0,1fr); }
.device-details strong { font-size: 15px; }
.device-details p, .device-details small, .device-row .button { font-size: 13px; }
.device-icon { background: var(--surface-soft); color: var(--muted); }
.security-details summary { font-size: 15px; color: var(--text); }
.security-details > .muted { font-size: 14px; }
.deletion-card { border-color: color-mix(in srgb,var(--danger) 30%,var(--line)); }
.deletion-card h2 { color: var(--danger); }
.profile-editor label, .profile-editor select, .profile-editor input, .profile-editor textarea,
.preference-choice, .profile-privacy-options label { font-size: 15px; }
.profile-editor legend { font-size: 18px; }
.profile-edit-header, .profile-editor small, .preference-choice small { font-size: 13px; }
.profile-editor input, .profile-editor select { min-height: 46px; }
.profile-editor input:not([type=checkbox]), .profile-editor select, .profile-editor textarea { font-size: 16px; }
.profile-editor label.preference-choice { font-size: 14px; line-height: 1.5; }
.profile-editor .preference-choice > input { width: 18px; height: 18px; }
.profile-editor input[type=checkbox], .profile-editor input[type=radio],
.admin-workspace input[type=checkbox], .admin-workspace input[type=radio] {
  width: 18px; height: 18px; min-height: 0; padding: 0; flex-shrink: 0; accent-color: var(--brand);
}
input[type=file]::file-selector-button {
  background: var(--surface-hover); color: var(--text); border: 0; border-radius: 6px;
  padding: 6px 10px; margin-right: 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.editor-divider p, .save-status, .media-upload-status { font-size: 13px; }
.empty-state h2, .profile-empty h2 { font-size: 24px; }
.empty-state > p, .profile-empty p { font-size: 15px; }
.friends-empty > .button { margin-top: 20px; }
.mfa-enrollment { max-width: 640px; min-width: 0; margin: 24px 0; overflow-wrap: anywhere; }
.mfa-qr { margin: 20px 0; }
.mfa-qr-code { display: block; max-width: 100%; height: auto; background: #fff; image-rendering: pixelated; }
.mfa-qr-code[hidden] { display: none; }
.mfa-manual { margin: 20px 0; }
.mfa-manual summary { cursor: pointer; font-weight: 600; }
.mfa-manual p { margin-top: 12px; }
.mfa-manual code { overflow-wrap: anywhere; }

/* Profiles, discovery and notifications. */
.profile-banner { height: 184px; background: linear-gradient(120deg,var(--hero),var(--surface-soft)); border-bottom: 1px solid var(--line); }
.profile-banner > .profile-cover-art { color: var(--muted); opacity: .18; width: 150px; height: 150px; margin-left: auto; }
.profile-identity { margin-top: -34px; gap: 20px; padding: 0 28px; }
.profile-identity .profile-avatar { width: 104px; height: 104px; border-width: 5px; color: var(--text); background: var(--accent); }
.profile-names { padding-top: 36px; }
.profile-names h2 { font-size: 28px; }
.profile-names p { font-size: 15px; }
.profile-actions { padding-top: 36px; gap: 10px; }
.profile-about { padding: 22px 28px 0; }
.profile-bio { font-size: 16px; line-height: 1.6; }
.profile-meta, .profile-about > .muted { font-size: 14px; }
.profile-meta .icon { width: 18px; height: 18px; color: var(--muted); }
.profile-meta a { color: var(--text); }
.profile-stats { font-size: 14px; gap: 24px; }
.profile-stats strong { font-size: 16px; }
.profile-tabs { padding: 0 28px; gap: 28px; overflow-x: auto; flex-wrap: nowrap; }
.profile-tabs > a { font-size: 14px; padding: 17px 0; white-space: nowrap; color: var(--muted); }
.profile-tabs > a[aria-current] { color: var(--text); font-weight: 650; border-color: var(--brand); }
.profile-content-grid { grid-template-columns: minmax(0,1fr) 296px; gap: 28px; }
.profile-friend strong { font-size: 15px; }
.profile-friend small { font-size: 13px; }
.friends-intro h2 { font-size: 23px; }
.friends-intro p, .friends-intro > a { font-size: 14px; }
.friends-tabs { padding: 8px 12px; gap: 6px; border-radius: 12px; flex-wrap: nowrap; overflow-x: auto; }
.friends-tabs a { position: relative; flex: 0 0 auto; padding: 10px 12px; font-size: 14px; border-radius: 10px; border-bottom: 0; transition: background .18s ease, color .18s ease; }
.friends-tabs [aria-current=page] { background: none; color: var(--text); }
.friends-tabs [aria-current=page]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -8px; height: 2px; border-radius: 2px; background: var(--brand); }
.friend-card { padding: 22px 24px; }
.friend-avatar { width: 50px; height: 50px; font-size: 20px; }
.friend-details strong { font-size: 16px; }
.friend-details p { font-size: 14px; }
.friend-status { display: inline-block; margin-top: 4px; font-size: 12px; }
.friend-menu summary { border: 0; background: transparent; border-radius: 50%; }
.friend-menu-option { font-size: 14px; padding: 12px; }
.friend-menu-option.is-danger { color: var(--danger); }
.search-card { padding: 26px; }
.search-card h2 { font-size: 22px; }
.search-card form { grid-template-columns: minmax(0,1fr) auto; }
.search-card input { min-height: 48px; font-size: 16px; border-radius: 10px; }
.search-card .muted, .search-section-heading p { font-size: 14px; }
.search-category > h3 { font-size: 18px; }
.person-result strong, .blocked-account strong { font-size: 16px; }
.person-result p, .blocked-account p { font-size: 14px; }
.notification-heading h2 { font-size: 22px; }
.notification-scroll { max-height: min(65dvh,720px); overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 2px 10px 2px 2px; border-radius: 16px; }
.notification-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.notification-scroll > .notification-card:last-child { margin-bottom: 0; }
.notification-card { padding: 24px; border-left-width: 1px; }
.notification-card.is-unread { border-left-color: var(--line); background: var(--surface); }
.notification-card.is-unread .notification-symbol { background: var(--brand-soft); color: var(--brand); }
.notification-symbol { width: 44px; height: 44px; flex-basis: 44px; color: var(--muted); background: var(--surface-soft); }
.notification-content h3 { font-size: 16px; }
.notification-content p, .notification-content time, .notification-card .button { font-size: 14px; }
.notification-toolbar [aria-current=page] { color: var(--text); border-color: var(--muted); background: var(--active); }
.social-comment strong { font-size: 15px; }
.social-comment p { font-size: 15px; }
.social-comment time, .social-comment button { font-size: 13px; }
.comments-card h2 { font-size: 21px; }
.comments-card textarea, .social-post select, .social-post textarea { font-size: 15px; }

/* Messaging uses quiet, distinct bubbles instead of red blocks. */
#account-chat { font-size: 15px; }
#account-chat input:not([type=checkbox]), #account-chat select { font-size: 16px; }
.chat-shell { border-radius: 16px; background: var(--surface); grid-template-columns: 290px minmax(0,1fr); height: clamp(600px,calc(100dvh - 220px),900px); min-height: 0; overflow: hidden; }
.chat-list { padding: 20px 16px; background: var(--surface); overflow-y: auto; min-height: 0; }
.chat-list h2 { font-size: 20px; }
.chat-list header { gap: 10px; }
.chat-list header .button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.chat-thread { border-radius: 12px; padding: 14px 12px; }
.chat-thread[aria-current=true] { background: var(--active); border-color: transparent; box-shadow: none; }
.chat-thread strong { font-size: 15px; }
.chat-thread small { font-size: 13px; margin-top: 4px; }
.chat-thread .chat-avatar, .chat-thread[aria-current=true] .chat-avatar { width: 44px; height: 44px; flex-basis: 44px; color: var(--text); background: var(--accent); border: 0; font-size: 16px; }
.chat-avatar { color: var(--text); background: var(--accent); width: 40px; height: 40px; flex-basis: 40px; }
.chat-conversation { min-height: 0; }
.chat-conversation > header { padding: 18px 22px; min-height: 78px; flex-shrink: 0; }
.chat-conversation > header h2 { font-size: 17px; }
.chat-conversation > header .button { font-size: 13px; }
.chat-history { padding: 18px 20px 24px; background: var(--bg); min-height: 100px; max-height: none; flex: 1 1 0; }
.chat-day-divider { font-size: 12px; letter-spacing: 0; }
.chat-day-divider span { padding: 4px 10px; }
.chat-message { padding: 11px 14px 8px; background: var(--surface); border-color: var(--line); box-shadow: none; }
.chat-message.own { background: var(--bubble-own); border-color: transparent; }
.chat-message .chat-message-text { font-size: 15px; line-height: 1.55; }
.chat-message-author { font-size: 13px; margin-bottom: 5px; }
.chat-message-meta, .chat-message-status { font-size: 12px; }
.chat-message-menu-trigger { font-size: 14px; }
.chat-message-options button { font-size: 14px; }
.chat-message-options button:hover, .chat-message-options button:focus-visible { background: var(--active); color: var(--text); }
.chat-composer { padding: 18px 20px; flex-shrink: 0; }
#account-chat .chat-composer textarea { display: block; height: 80px; min-height: 80px; max-height: min(280px,35dvh); overflow-y: hidden; resize: none; font-size: 16px; line-height: 1.5; background: var(--surface-soft); border-color: transparent; }
.chat-composer-actions .button { font-size: 13px; min-height: 40px; }
.chat-info-heading h2 { font-size: 22px; }
.chat-info-heading p, .chat-info-person-identity > span { font-size: 14px; }
.chat-info-person-identity a { font-size: 15px; }
.chat-info-section-heading h3, .chat-info-role, .chat-info-count { font-size: 13px; }
.chat-info-settings label, .chat-info-settings p, .chat-info-privacy p,
.chat-info-management > summary, .chat-info-privacy > summary { font-size: 14px; }
.chat-info-member-options .chat-info-member-option { font-size: 14px; }
.chat-info-footer .button { font-size: 14px; }
.chat-info-close { width: 38px; height: 38px; }
.chat-info-close svg { width: 20px; height: 20px; }
.chat-privacy-options { display: grid; gap: 12px; margin-top: 22px; }
#account-chat label.chat-privacy-option { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); cursor: pointer; }
.chat-privacy-option input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; margin: 3px 0 0; padding: 0; accent-color: var(--brand); }
.chat-privacy-option strong { display: block; font-size: 15px; font-weight: 650; line-height: 1.5; }
.chat-privacy-option small { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.chat-privacy-note { font-size: 13px; line-height: 1.6; margin: 20px 0 0; }
#account-chat [data-create-dialog] { width: 560px; border-radius: 22px; }
.chat-contact-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.chat-contact-heading h2 { margin: 0; font-size: 23px; }
.chat-contact-hint { font-size: 14px; margin: 10px 0 18px; }
.chat-contact-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); padding: 0 14px; }
.chat-contact-search > .icon { width: 19px; height: 19px; color: var(--muted); }
#account-chat .chat-contact-search input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 13px 0; margin: 0; outline: none; }
.chat-contact-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb,var(--focus) 12%,transparent); }
.chat-contact-list, [data-add-members] { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px; margin: 14px -4px 0; }
#account-chat label.chat-contact-option { display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin: 0; border: 1px solid transparent; border-radius: 14px; background: var(--surface-soft); cursor: pointer; transition: background .18s ease,border-color .18s ease; }
#account-chat label.chat-contact-option:hover { background: var(--surface-hover); }
#account-chat label.chat-contact-option:has(input:checked) { background: var(--active); border-color: color-mix(in srgb,var(--brand) 45%,var(--line)); }
.chat-contact-option:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.chat-contact-avatar { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--accent); color: var(--text); font-size: 17px; font-weight: 650; overflow: hidden; }
.chat-contact-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-contact-identity { display: grid; gap: 3px; min-width: 0; flex: 1; }
.chat-contact-identity strong { font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.chat-contact-identity small { font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.chat-contact-option input[type=checkbox] { width: 19px; height: 19px; flex: 0 0 19px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.chat-contact-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.chat-contact-footer > span { font-size: 13px; overflow-wrap: anywhere; }
.chat-contact-footer .chat-dialog-actions { margin: 0; flex-shrink: 0; gap: 10px; }
.chat-contact-footer .button { border-radius: 999px; }
.chat-contact-empty { padding: 22px 12px; text-align: center; font-size: 14px; margin: 0; }
.chat-contact-error { color: var(--danger); font-size: 14px; margin: 16px 0 0; }
@media (max-width: 540px) {
  .chat-contact-heading h2 { font-size: 21px; }
  #account-chat label.chat-contact-option { padding: 12px; }
  .chat-contact-footer { align-items: stretch; flex-direction: column; gap: 14px; }
  .chat-contact-footer .chat-dialog-actions { width: 100%; }
  .chat-contact-footer .button { flex: 1; }
  .chat-contact-list { max-height: 36dvh; }
}

/* Staff screens keep their dense data layout, without miniature type. */
.admin-sidebar .nav-item { font-size: 14px; padding: 11px 12px; min-height: 44px; gap: 12px; }
.admin-sidebar .nav-item .icon { width: 21px; height: 21px; }
.admin-sidebar .brand { margin-bottom: 32px; }
.admin-sidebar .sidebar-bottom { padding-top: 24px; }
.admin-section-heading h2 { font-size: 26px; }
.admin-section-heading .muted { font-size: 14px; }
.admin-metric { padding: 24px; }
.admin-metric h3 { font-size: 14px; }
.admin-metric strong { font-size: 32px; }
.admin-metric p { font-size: 13px; }
.admin-chart svg text { font-size: 17px; }
.admin-chart details { font-size: 14px; }
.chart-series { stroke: var(--brand); vector-effect: non-scaling-stroke; stroke-width: 1.8; }
.chart-point { fill: var(--brand); }
.admin-table, .admin-definition-list { font-size: 14px; }
.admin-table th, .admin-table td { padding: 16px; }
.admin-table thead { background: var(--surface-soft); }
.admin-table .button { font-size: 13px; }
.admin-range label, .admin-table-filters label, .admin-form-grid label { font-size: 14px; }
.admin-range .button { align-self: flex-end; height: 46px; }
.admin-workspace input, .admin-workspace select, .admin-workspace textarea { font-size: 15px; padding: 12px; }
.admin-workspace form[action^="/admin/manage"] label { font-size: 14px; }
.admin-workspace form[action^="/admin/manage"] input:not([type=checkbox]):not([type=hidden]),
.admin-workspace form[action^="/admin/manage"] select,
.admin-workspace form[action^="/admin/manage"] textarea { font-size: 15px; }
.admin-account-result { border-radius: 12px; }
.admin-account-identity strong, .admin-account-detail h2 { font-size: 17px; }
.admin-account-identity > span, .admin-account-meta, .admin-account-open { font-size: 14px; }
.admin-account-status { font-size: 12px; }
.admin-account-identity .admin-account-email { font-size: 13px !important; }
.admin-account-facts { font-size: 14px; }
.admin-action-option strong { font-size: 15px; }
.admin-action-option > span > span, .admin-action-footer p { font-size: 13px; }
.admin-account-history article > div, .admin-account-history article p { font-size: 14px; }
.admin-account-history time, .admin-account-history article > span { font-size: 13px; }
#smtp p, #smtp dl, #smtp code { font-size: 14px; }
#smtp h3 { font-size: 17px; }
.admin-account-result:hover { background: var(--surface-soft); border-color: var(--muted); }
.admin-action-card strong { font-size: 15px; }
.admin-action-card small, .admin-action-card span { font-size: 13px; }
.report-status, .report-content .muted, .report-decision .muted { font-size: 13px; }
.report-author small { font-size: 14px; }
.report-author .chat-avatar { color: var(--text); background: var(--accent); }
.report-body { font-size: 16px; }
.report-filters label { font-size: 14px; }
dialog { box-shadow: var(--menu-shadow); }
.message-dialog { box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); }
.message-dialog::backdrop { background: #000a; }
.message-dialog h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.3; }
.message-dialog p { margin: 0 0 24px; color: var(--text); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.message-dialog-actions .button { margin: 0; }
@media (max-width: 480px) { .message-dialog { padding: 22px; } .message-dialog-actions .button { flex: 1; } }
dialog:modal {
  position: fixed;
  inset: 0;
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.admin-workspace [data-admin-confirm] .chat-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* Responsive layout: reading width first, then a single-column mobile app. */
@media (min-width: 1700px) {
  .main { padding-left: 48px; padding-right: 48px; }
  .content-grid { grid-template-columns: minmax(0,1fr) 312px; gap: 32px; }
}
@media (max-width: 1270px) and (min-width: 801px) {
  :root { --sidebar-width: 224px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand-name { font-size: 21px; }
  .nav-item { font-size: 15px; gap: 12px; }
  .main { padding: 28px; }
  .topbar { padding: 0 28px; }
  .content-grid, .profile-content-grid { grid-template-columns: minmax(0,1fr) 260px; gap: 22px; }
  .right-rail .settings-card, .profile-side .settings-card { padding: 20px; }
  .composer-submit { flex-wrap: wrap; }
  .composer-submit .composer-visibility { flex-basis: 100%; justify-content: flex-start; margin-bottom: 6px; }
  .sidebar-collapsed { --sidebar-width: 88px; }
  .chat-shell { grid-template-columns: 248px minmax(0,1fr); }
}
@media (max-width: 1100px) {
  .content-grid, .profile-content-grid { grid-template-columns: minmax(0,1fr); }
  .right-rail, .profile-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .header-search { min-width: 190px; width: 210px; }
  .auth-grid { grid-template-columns: 1fr; max-width: 620px; }
  .auth-message { display: none; }
  .auth-card { max-width: none; }
  .profile-actions { width: 100%; padding-top: 0; margin-left: 0; }
}
@media (max-width: 800px) {
  :root { --sidebar-width: 264px; }
  .sidebar { width: 264px; padding: 24px 16px; }
  .sidebar .brand-name { font-size: 23px; }
  .sidebar .brand { margin: 0 0 32px; }
  .sidebar .sidebar-collapse { top: 29px !important; right: 14px !important; }
  .sidebar .nav-item { min-height: 50px; font-size: 16px; }
  .sidebar-collapsed .sidebar { width: 264px; padding: 24px 16px; }
  .sidebar-collapsed .sidebar .brand { margin: 0 0 32px; }
  .sidebar-collapsed .sidebar .nav-item { justify-content: flex-start; padding: 12px 14px; }
  .workspace { margin-left: 0; width: 100%; }
  .topbar { height: 68px; padding: 0 20px; gap: 12px; }
  .header-start, .header-actions { gap: 8px; }
  .mobile-menu { display: inline-flex; width: 38px; }
  .mobile-brand { font-size: 22px; white-space: nowrap; }
  .mobile-brand > span { color: var(--brand); }
  .breadcrumb, .header-search, .header-divider, .account-name { display: none; }
  .mobile-search { display: inline-flex; }
  .notification-link { width: 38px; height: 38px; }
  .notification-link .icon { width: 22px; height: 22px; }
  .header-actions .avatar { width: 36px; height: 36px; font-size: 14px; }
  .header-actions .button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .header-login { font-size: 14px; }
  .main { padding: 26px 22px 20px; }
  .page-heading h1 { font-size: 28px; }
  .eyebrow { font-size: 11px; }
  .content-grid { gap: 24px; }
  .social-welcome h2 { font-size: 28px; }
  .post-composer { padding: 22px; }
  .social-post { padding: 20px 22px 12px; }
  .right-rail, .profile-side { grid-template-columns: 1fr 1fr; }
  .chat-shell { grid-template-columns: 1fr; height: clamp(520px,calc(100dvh - 190px),800px); min-height: 0; }
  .chat-history { max-height: none; padding: 16px; }
  .chat-message { max-width: 88%; }
  .chat-conversation > header { padding: 16px; }
  .chat-conversation > header h2 { font-size: 16px; }
  .admin-sidebar .nav-item { font-size: 14px; min-height: 44px; }
  .admin-section-heading { min-width: 0; }
  .admin-section-heading h2, .admin-section-heading p { overflow-wrap: anywhere; }
  .social-post select, .social-post textarea, .comments-card textarea { font-size: 16px; }
  .admin-workspace input, .admin-workspace select, .admin-workspace textarea,
  .admin-workspace form[action^="/admin/manage"] input:not([type=checkbox]):not([type=hidden]),
  .admin-workspace form[action^="/admin/manage"] select,
  .admin-workspace form[action^="/admin/manage"] textarea { font-size: 16px; }
}
@media (max-width: 540px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .header-start, .header-actions { gap: 3px; }
  .mobile-brand { font-size: 20px; }
  .mobile-search { width: 34px; }
  .header-actions .button .icon { display: none; }
  .header-actions .button { font-size: 12px; padding: 8px 10px; }
  .header-login { font-size: 13px; }
  .main { padding: 24px 14px 18px; }
  .page-heading { margin-bottom: 24px; }
  .page-heading h1 { font-size: 26px; }
  .social-welcome { margin-bottom: 20px; padding: 0 4px; }
  .social-welcome h2 { font-size: 27px; }
  .social-welcome p { font-size: 14px; }
  .post-composer { padding: 18px; border-radius: 22px; }
  .composer-heading p { font-size: 13px; }
  .composer-heading h2 { font-size: 15px; }
  .post-composer textarea { min-height: 108px; padding: 12px 14px; font-size: 16px; border-radius: 16px; }
  .composer-input-row { gap: 12px; }
  .composer-toolbar { gap: 8px; flex-wrap: nowrap; }
  .composer-toolbar .composer-media-controls label { padding: 7px 10px; }
  .composer-toolbar .composer-attachment-label { display: none; }
  .composer-meta { gap: 4px; flex-wrap: nowrap; }
  .post-composer .emoji-picker { gap: 0; padding: 3px; }
  .post-composer .emoji-picker button { width: 28px; height: 32px; font-size: 18px; }
  .composer-media-controls > span { font-size: 12px; }
  .composer-submit { gap: 8px; }
  .composer-submit .composer-visibility { flex-basis: 100%; justify-content: center; margin-bottom: 4px; }
  .composer-visibility label { flex: 1; text-align: center; }
  .composer-visibility span { font-size: 13px; padding: 9px 8px; }
  .composer-visibility .icon { display: none; }
  .composer-submit > .button { flex: 1; font-size: 13px; }
  .feed-heading { gap: 12px; margin-top: 24px; }
  .feed-heading h2 { font-size: 18px; }
  .feed-sorts { width: auto; flex: 1; max-width: 250px; }
  .feed-sorts a { font-size: 13px; padding: 7px 10px; flex: 1; text-align: center; }
  .post-stream { padding-right: 5px; max-height: 70vh; }
  .post-stream [data-stream-items] { gap: 14px; }
  .social-post { padding: 18px 16px 10px; border-radius: 13px; }
  .post-header { gap: 10px; }
  .post-header > .avatar { width: 38px; height: 38px; flex-shrink: 0; }
  .post-author p { font-size: 12px; }
  .post-audience { display: none; }
  .post-actions { gap: 2px; }
  .post-actions button, .post-actions a { gap: 5px; padding: 6px 4px; font-size: 12px; }
  .post-actions .icon { width: 19px; height: 19px; }
  .right-rail, .profile-side { grid-template-columns: 1fr; }
  .right-rail .settings-card, .profile-side .settings-card { padding: 22px; }
  .page-footer { font-size: 12px; flex-wrap: wrap; gap: 12px; }
  .profile-banner { height: 144px; }
  .profile-identity { padding: 0 20px; gap: 14px; }
  .profile-identity .profile-avatar { width: 88px; height: 88px; }
  .profile-names { padding-top: 38px; }
  .profile-names h2 { font-size: 24px; }
  .profile-names p { font-size: 14px; }
  .profile-actions { padding-top: 4px; gap: 8px; }
  .profile-actions .button { font-size: 13px; }
  .profile-about { padding: 22px 20px 0; }
  .profile-meta { font-size: 13px; gap: 12px; }
  .profile-tabs { padding: 0 20px; gap: 24px; }
  .profile-tabs > a { font-size: 13px; }
  .friends-tabs { gap: 4px; padding: 8px; }
  .friends-tabs a { flex-basis: auto; font-size: 14px; padding: 10px 12px; }
  .friend-card { padding: 20px; }
  .friends-intro p, .friends-intro > a { font-size: 14px; }
  .search-card { padding: 20px; }
  .search-card h2 { font-size: 20px; }
  .search-card form { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .search-card .button { grid-column: auto; }
  .auth-card { padding: 28px 22px; }
  .auth-card h2 { font-size: 24px; }
  .auth-links { font-size: 13px; }
  .settings-card { padding: 24px 20px; }
  .account-info { grid-template-columns: 90px minmax(0,1fr); font-size: 14px; }
  .theme-option span { font-size: 13px; padding: 22px 8px; }
  .device-details small { font-size: 12px; }
  .notification-card { padding: 20px 16px; gap: 12px; }
  .notification-symbol { width: 38px; height: 38px; flex-basis: 38px; }
  .notification-toolbar { align-items: flex-start; flex-direction: column; }
  .chat-shell { border-radius: 12px; }
  .chat-message .chat-message-text { font-size: 15px; }
  .chat-message-meta, .chat-message-status { font-size: 12px; }
  .chat-composer { padding: 14px; }
  .chat-composer-actions { gap: 8px; }
  .chat-composer-actions .button { font-size: 13px; padding: 9px 12px; }
  .chat-info-role { font-size: 12px; padding: 3px 6px; }
  .chat-info-heading h2 { font-size: 20px; }
  .admin-definition-list { font-size: 14px; }
  .admin-workspace .settings-card { padding: 22px 18px; }
  .admin-metric { padding: 20px; }
  .admin-metric h3 { font-size: 13px; }
  .admin-metric strong { font-size: 28px; }
  .admin-chart svg text { font-size: 24px; }
  .admin-chart svg text:first-of-type { transform: translateY(5px); }
}
[data-post-stream="own-posts"] .text-link + [data-own-delete] {
  margin-inline-start: 16px;
}

.social-comment { position: relative; flex-wrap: wrap; }
.social-comment > div { padding-inline-end: 44px; }
.social-comment > .comment-report-menu { flex-basis: 100%; min-width: 0; margin: 0; }
.social-comment > .comment-report-menu:not([open]) { position: absolute; top: 0; right: 0; }
.comment-report-menu > summary {
  position: absolute; top: 18px; right: 0;
  list-style: none; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 10px;
  cursor: pointer; transition: background-color .18s ease, color .18s ease;
}
.comment-report-menu > summary .icon { width: 16px; height: 16px; }
.comment-report-menu > summary::-webkit-details-marker { display: none; }
.comment-report-menu[open] > summary { background: var(--active); color: var(--text); }
.comment-report-menu form {
  display: grid; gap: 16px; width: 100%; max-width: 420px;
  padding: 20px; margin-top: 10px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.comment-report-menu h4 { margin: 0; font-size: 16px; }
.comment-report-menu label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; }
.comment-report-menu select {
  appearance: none; width: 100%; min-width: 0; min-height: 46px;
  padding: 11px 40px 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  background-color: var(--surface-soft); color: var(--text); font: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23949eac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer; transition: border-color .18s ease, background-color .18s ease;
}
.comment-report-menu select:hover { border-color: var(--muted); background-color: var(--surface-hover); }
.comment-report-menu select:focus { border-color: var(--focus); }
.comment-report-menu option { background: var(--surface); color: var(--text); }
.comment-report-menu textarea { width: 100%; min-width: 0; border-radius: 12px; }
.comment-report-menu form > button { justify-self: start; }
.comment-report-menu [role=status] { margin: 0; }
.comment-report-menu [role=status]:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .comment-report-menu > summary, .comment-report-menu select { transition: none; }
}

@media (max-width: 360px) {
  .composer-toolbar { gap: 7px; }
  .composer-toolbar .emoji-picker button { width: 26px; font-size: 17px; }
  .composer-toolbar .composer-media-controls label { padding: 7px 8px; }
  .composer-toolbar output { font-size: 12px; }
  .feed-heading .feed-sorts { flex-basis: 100%; max-width: none; }
  .header-actions { gap: 0; }
}


/* Shared dropdown controls and menus across public, account and staff screens. */
:root select {
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
:root select:hover:not(:disabled) { border-color: var(--muted); }
:root select:focus-visible { border-color: var(--focus); }
:root select:disabled { opacity: .5; cursor: not-allowed; }
:root select option, :root select optgroup {
  background: var(--surface);
  color: var(--text);
}

@supports (appearance: base-select) {
  :root select:not([multiple]):not([size]),
  :root select:not([multiple])[size="1"],
  ::picker(select) {
    appearance: base-select;
  }
  :root select:not([multiple]):not([size]),
  :root select:not([multiple])[size="1"] {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background-image: none;
  }
  select::picker-icon {
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
    flex-shrink: 0;
    color: var(--muted);
    content: "⌄";
    font-size: 20px;
    line-height: 12px;
  }
  select:open { border-color: var(--focus); }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) {
    padding: 6px;
    margin-block: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--menu-shadow);
    max-height: min(360px, 60dvh);
    max-width: calc(100vw - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    font: inherit;
    color-scheme: inherit;
  }
  :root select option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  :root select option:checked { background: var(--brand-soft); color: var(--brand); }
  :root select option:hover,
  :root select option:focus-visible { background: var(--surface-hover); color: var(--text); }
  :root select option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  select option::checkmark { color: var(--brand); margin-inline-start: auto; order: 1; }
  :root select option:disabled { color: var(--muted); opacity: .5; cursor: not-allowed; }
}

.account-dropdown,
.chat-message-options {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--menu-shadow);
}
.account-dropdown :is(a, button):focus-visible,
.chat-message-options button:focus-visible {
  background: var(--surface-hover);
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* Image editing controls are rendered only for the profile owner. */
.profile-image-editable { position: relative; }
.profile-avatar-editor { width: 104px; height: 104px; flex-shrink: 0; }
.profile-avatar-editor .profile-avatar { display: flex; }
.profile-image-upload {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  border: 0;
  background: #0005;
  color: #fff;
  cursor: pointer;
  opacity: 0;
}
.profile-banner-upload { display: flex; align-items: flex-start; justify-content: flex-end; }
.profile-image-upload > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.profile-avatar-upload { border-radius: 50%; padding: 5px; }
.profile-avatar-upload > span {
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  border-radius: 50%;
  background: #0009;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}
.profile-image-remove {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
}
.profile-avatar-editor .profile-image-remove { inset-block-start: -3px; inset-inline-start: auto; inset-inline-end: -3px; }
.profile-image-editable:hover > .profile-image-upload,
.profile-image-editable:focus-within > .profile-image-upload,
.profile-image-editable:hover > .profile-image-remove,
.profile-image-editable:focus-within > .profile-image-remove { opacity: 1; }
.profile-image-upload:disabled, .profile-image-remove:disabled { cursor: not-allowed; }
.profile-direct-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 28px 0;
}
.profile-direct-upload[hidden], .profile-direct-upload [hidden] { display: none; }
.profile-direct-upload .media-upload-status { flex: 1; margin: 0; }
.profile-direct-upload progress { flex-basis: 100%; margin: 0; }
.profile-direct-upload[data-enabled=false] [data-media-cancel] { display: none; }
@media (hover: none) {
  .profile-image-upload, .profile-image-remove { opacity: 1; }
  .profile-banner-upload { background: transparent; }
  .profile-avatar-upload { display: flex; align-items: flex-end; justify-content: flex-end; background: transparent; }
  .profile-avatar-upload > span { width: 30px; height: 30px; padding: 6px; background: var(--primary); color: var(--on-primary); }
  .profile-avatar-upload > span > span { display: none; }
  .profile-avatar-upload .icon { width: 18px; height: 18px; }
}
@media (max-width: 540px) {
  .profile-avatar-editor { width: 88px; height: 88px; }
  .profile-direct-upload { margin-inline: 22px; }
}

/* Shared, immediate loading feedback. Skeletons reserve space without exposing old content. */
.loading-skeleton{display:grid;gap:18px;width:100%;pointer-events:none}
.skeleton-item{display:grid;gap:12px;padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.skeleton-line{display:block;width:100%;height:12px;border-radius:6px;background:var(--surface-soft);position:relative;overflow:hidden}
.skeleton-line:after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent,color-mix(in srgb,var(--muted) 12%,transparent),transparent);transform:translateX(-100%);animation:skeleton-shimmer 1.5s ease-in-out infinite}
.skeleton-line:first-child{width:38%;height:16px;margin-bottom:8px}.skeleton-line:last-child{width:68%}
.loading-skeleton-rows{gap:10px}.loading-skeleton-rows .skeleton-item{min-height:76px;padding:16px 16px 16px 64px;position:relative;gap:8px}
.loading-skeleton-rows .skeleton-item:before{content:"";position:absolute;left:14px;top:18px;width:34px;height:34px;border-radius:50%;background:var(--surface-soft)}
.loading-skeleton-rows .skeleton-line{height:9px}.loading-skeleton-rows .skeleton-line:first-child{width:60%;height:12px;margin:0}.loading-skeleton-rows .skeleton-line:last-child{display:none}
.loading-skeleton-messages{margin:auto 0 0;gap:16px;padding:16px 4px}
.loading-skeleton-messages .skeleton-item{width:64%;padding:14px;border-radius:4px 15px 15px 15px;background:var(--surface-soft);gap:8px}
.loading-skeleton-messages .skeleton-item:nth-child(even){width:48%;margin-left:auto;border-radius:15px 4px 15px 15px;background:var(--active)}
.loading-skeleton-messages .skeleton-line{height:10px;background:color-mix(in srgb,var(--muted) 14%,transparent)}
.loading-skeleton-messages .skeleton-line:first-child{width:84%;margin:0}.loading-skeleton-messages .skeleton-line:last-child{width:40%}
.chat-load-error{margin:auto;text-align:center;padding:24px}.chat-load-error p{color:var(--muted)}
.chat-thread[aria-busy=true]:after{content:"";width:14px;height:14px;border:2px solid var(--line);border-top-color:var(--primary);border-radius:50%;animation:loading-spin .7s linear infinite;flex-shrink:0}
#account-chat [data-info-load-status]:empty,#account-chat [data-privacy-error]:empty{display:none}
#account-chat [data-privacy-dialog][aria-busy=true] .chat-privacy-options{opacity:.5}
.chat-composer-actions:has(#chat-files:disabled) label[for=chat-files]{opacity:.5;cursor:default}
.navigation-pending:before{content:"";position:fixed;top:0;left:0;z-index:3000;width:40%;height:3px;background:var(--primary);animation:navigation-progress 1.2s ease-in-out infinite}
.main.is-navigating{position:relative;min-height:65vh}.main.is-navigating>:not(.navigation-preview){visibility:hidden}
.navigation-preview{position:absolute;inset:0;padding:24px 0;z-index:2;background:var(--bg);min-height:100%}
.navigation-loading-label{font-size:14px;color:var(--muted);margin:0 0 24px}
[data-post-stream]>.loading-skeleton{padding:16px 0}
@keyframes skeleton-shimmer{to{transform:translateX(100%)}}
@keyframes loading-spin{to{transform:rotate(360deg)}}
@keyframes navigation-progress{from{transform:translateX(-100%)}to{transform:translateX(350%)}}
@media(prefers-reduced-motion:reduce){.skeleton-line:after,.chat-thread[aria-busy=true]:after,.navigation-pending:before{animation:none}.navigation-pending:before{width:100%;opacity:.65}}
