/* Shared compact layout, calibrated to the member's social-feed reference.
   14px body / 12px metadata / 24px action icons; 4, 8, 12, 16, 24px spacing. */
:root {
  --ui-text-caption: .75rem;
  --ui-text-body: .875rem;
  --ui-text-label: .875rem;
  --ui-text-heading: 1.125rem;
  --ui-radius-control: .5rem;
  --ui-radius-panel: .75rem;
  --ui-gap: .75rem;
  --ui-panel-padding: 1rem;
  --ui-control-height: 2.75rem;
  --compact-gutter: 1rem;
}
#app, #auth, body > dialog {
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: var(--font-body);
  --font-display: var(--font-body);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .875rem;
  line-height: 1.45;
}
#app :is(h1, h2, h3, h4, .page-title, .lp-title, .post-title),
#auth :is(h1, h2, h3), body > dialog :is(h2, h3) { font-family: inherit; }
#app :is(button, input, select, textarea), #auth :is(button, input, select, textarea), dialog :is(button, input, select, textarea) { font-family: inherit; }
#app .icon, dialog .icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
#app :is(.top-actions, .post-actions, .floating-nav) .icon { width: 1.5rem; height: 1.5rem; stroke-width: 1.8; }
#app :is(.icon-btn, .back-btn), dialog .icon-btn { min-width: 44px; min-height: 44px; }
#app .topbar { min-height: 56px; padding-block: 4px; padding-inline: var(--compact-gutter); gap: 8px; }
#app .top-actions { gap: 0; }
#app .topbar .top-brand { font-size: 1.25rem; line-height: 1.2; white-space: nowrap; letter-spacing: -.04em; }
#app .topbar .brand-mark { height: 22px; width: auto; }
#app #view-title { font-family: inherit; font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
#app .column:not(.feed-column), #app .feed-column { padding: 16px var(--compact-gutter) 24px; }
#app .page-title { margin: 0 0 16px; font-size: 1.5rem; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
#app :is(.section-head, .section-row, .g-section-head, .inbox-heading, .m-toolbar) { gap: 8px 12px; margin-bottom: 12px; }
#app :is(.section-head, .section-row, .g-section-head) h2 { font-size: 1.125rem; line-height: 1.35; letter-spacing: -.015em; }
#app :is(.small, .muted.small, .ib-preview, .direction-description, .cc-desc, .ca-note) { font-size: .8125rem; line-height: 1.45; }
#app .g-kicker { font-size: .6875rem; letter-spacing: .05em; line-height: 1.4; }
#app :is(.card:not(.post), .cc, .compose-card, .g-settings, .p-card, .lp-card, .lj-card, .qa-item, .skills-listing, .match-card, .listing-card, .exchange-card, .m-me, .m-campaign, .m-progress, .m-propose, .m-stance, .m-request, .m-kudos, .m-role, .m-profile, .a-panel, .a-request) {
  padding: var(--ui-panel-padding); border-radius: var(--ui-radius-panel); box-shadow: none;
}
#app :is(.primary, .ghost, .g-cta, .seg button, .chip), dialog :is(.primary, .ghost) { font-size: .875rem; line-height: 1.35; padding: 8px 12px; font-weight: 600; }
#app :is(input, textarea, select), #auth :is(input, textarea, select), dialog :is(input, textarea, select) { font-size: 1rem; line-height: 1.5; }
#app :is(.auth-form, .m-form, .skills-form, .task-form), dialog form { gap: 12px; }
#app :is(.auth-form, .m-form, .skills-form, .task-form) label, dialog label { font-size: .875rem; line-height: 1.4; }
#app :is(.lp, .qa-list, .skills-content, .skills-section, .m-content, .m-list, .a-panel, .learning-directions) { gap: 12px; }
#app :is(.lp-title, .direction-title) { font-size: 1rem; line-height: 1.4; font-weight: 600; }
#app .learning-direction { padding: 16px; gap: 12px; border-radius: 12px; }
#app .direction-action { margin-top: 0; padding-top: 12px; font-size: .8125rem; }
#app .direction-topics > span { font-size: .75rem; }
#app .m-hero { padding: 16px; border-radius: 12px; }
#app #mission-body .m-hero .m-statement { font-size: 1.375rem; line-height: 1.35; letter-spacing: -.02em; }
#app :is(.m-stat strong, .a-tile strong, .p-stat strong) { font-family: inherit; font-size: 1.375rem; line-height: 1.25; }
#app :is(.m-stat span, .a-tile span, .p-stat span) { font-size: .75rem; line-height: 1.4; }
#app :is(.ib-row, .m-leader, .new-message-member, .share-member-row) { min-height: 64px; padding: 12px; gap: 12px; border-radius: 8px; }
#app .ib-name { font-size: .875rem; }
#app .main :is(th, td) { padding: 10px 12px; font-size: .8125rem; line-height: 1.45; }
#app .msg-text { font-size: .875rem; line-height: 1.5; }
#app .home-hero, #app .home-hero.has-daily-quote { min-height: 0; padding: 16px; margin: 0 0 16px; border-radius: 12px; }
#app .home-hero-text { gap: 8px; padding: 0; }
#app .home-hero .home-hero-text h1 { font-size: 1.5rem; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; }
#app .home-hero .home-hero-lead, #app .home-hero .daily-quote-inline blockquote { font-family: inherit; font-size: .875rem; line-height: 1.5; font-weight: 400; font-style: normal; }
#app .home-hero-text > p:last-child { font-size: .75rem; }
#app .stories { padding: 0 0 12px; gap: 16px; }
#app .stories .story-ring { width: 56px; height: 56px; padding: 2px; }
#app .story-label { font-size: .75rem; line-height: 1.35; margin-top: 4px; }
#app .compose-card { margin-bottom: 12px; }
#app .compose-row { gap: 8px; }
#app .compose-input { font-size: .875rem; line-height: 1.4; padding: 8px 12px; }
#app .compose-chips { margin-top: 8px; padding-top: 8px; gap: 4px; }
#app .compose-chips button { font-size: .75rem; gap: 4px; min-height: 44px; }
#app .compose-chips .icon { width: 18px; height: 18px; }
#app .feed-heading { padding: 8px 0 12px; gap: 12px; }
#app .feed-heading .g-kicker { margin: 0 0 4px; }
#app .feed-heading h2 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
#app .feed-heading > span { font-size: .75rem; }
#app .post-list { gap: 0; }
#app .card.post { padding: 0; background: var(--bg); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
#app .post-head { min-height: 60px; padding: 8px 12px; gap: 10px; }
#app .post-head .avatar { width: 32px; height: 32px; min-width: 32px; font-size: .875rem; }
#app .post-who { gap: 2px; min-width: 0; }
#app .post-who :is(strong, .user-link) { font-size: .875rem; line-height: 1.35; font-weight: 600; }
#app .post-who .small { font-size: .75rem; line-height: 1.35; }
#app .post-head .track-chip { min-height: 32px; padding: 6px 12px; font-size: .8125rem; border-radius: 8px; }
#app .post-media { margin: 0; border-radius: 0; overflow: hidden; }
#app .post-img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; border-radius: 0; }
#app .post-media:hover .post-img { transform: none; }
#app .post-body { padding: 0 12px 12px; }
#app .post-actions { padding: 0; gap: 4px; min-height: 44px; }
#app .post-actions .icon-action { min-width: 44px; min-height: 44px; padding: 8px 4px; gap: 4px; font-size: .8125rem; }
#app .post-actions .save-post { margin-left: auto; }
#app .post-text { padding: 0; margin: 0 0 8px; background: transparent; border: 0; border-radius: 0; min-height: 0; }
#app .post-title { margin: 0; font-family: inherit; font-size: .875rem; line-height: 1.45; font-weight: 600; letter-spacing: 0; }
#app .post-desc { margin: 4px 0 0; font-size: .875rem; line-height: 1.45; font-weight: 400; }
#app .post:not(:has(.post-media)) .post-body { display: flex; flex-direction: column; }
#app .post:not(:has(.post-media)) .post-text { order: -1; margin-top: 4px; }
#app .post:not(:has(.post-media)) .post-actions { margin-top: 0; }
#app .comment-text, #app .post .comment-cloud > .comment-text { font-size: .875rem; line-height: 1.45; padding: 8px 12px; }
#app .comments { gap: 8px; margin: 8px 0; }
#app .comment-meta { gap: 6px; font-size: .8125rem; }
#app .comment-meta time { font-size: .75rem; }
#app .comment-form { margin-top: 8px; }
body > dialog { padding: 16px; border-radius: 12px; }
body > dialog :is(h2, h3) { font-size: 1.125rem; line-height: 1.35; margin-bottom: 12px; }
#auth .auth-card { padding: 24px; border-radius: 12px; }
#auth .auth-form h2 { font-size: 1.5rem; line-height: 1.25; }
@media (max-width: 999px) {
  #app .main { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  #app .tabbar.floating-nav {
    position: absolute; inset-inline: 0; bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px)); min-height: 56px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); gap: 4px;
    background: var(--bg); border: 0; border-top: 1px solid var(--border);
    border-radius: 0; box-shadow: none;
  }
  #app .floating-nav > button { min-height: 44px; padding: 8px; gap: 0; border-radius: 24px; color: var(--muted); }
  #app .floating-nav > button.active { color: var(--text); background: var(--hover); }
  #app .floating-nav > button .tab-label { display: none; }
  #app .mobile-feed-top { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  #app .app-update-notice { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767px) {
  :root { --compact-gutter: 12px; --ui-panel-padding: 12px; }
  #app .feed-column { padding-inline: 0; }
  #app .feed-column > :not(.post-list) { width: calc(100% - 24px); margin-left: 12px; margin-right: 12px; }
  #app .feed-column > .post-list { width: 100%; }
  #app .post-actions .discussion-label { display: none; }
  #app .home-hero-art { display: none; }
  #app .home-hero { grid-template-columns: minmax(0, 1fr); }
  #app .feed-heading > span { display: none; }
  #app .page-title { font-size: 1.375rem; }
  #app .stories .story-ring { width: 52px; height: 52px; }
  #app :is(.card, .cc, .g-settings, .p-card, .lp-card, .a-panel) { overflow-wrap: anywhere; }
  body > dialog { padding: 16px; max-width: calc(100vw - 24px); }
}
@media (min-width: 1000px) {
  :root { --compact-gutter: 24px; }
  #app .workspace-rail { padding: 16px 12px; }
  #app :is(.workspace-links, .rail-bottom) button { font-family: inherit; min-height: 44px; padding: 10px 12px; font-size: .875rem; gap: 12px; }
  #app .workspace-links { gap: 4px; }
  #app .feed-column { display: grid; grid-template-columns: minmax(0, 640px); justify-content: center; gap: 12px; }
  #app .feed-column > * { grid-area: auto; width: 100%; }
  #app .column:not(.feed-column) { max-width: 1120px; }
  #app .post-img { max-height: 800px; }
}
@media (min-width: 1400px) {
  #app .feed-column { grid-template-columns: minmax(0, 640px) minmax(240px, 280px); gap: 12px 24px; }
  #app #feed-hero { grid-area: 1 / 1 / 2 / 3; }
  #app #feed-top { grid-area: 2 / 1 / 3 / 3; }
  #app #feed-mission { grid-area: 3 / 2 / 7 / 3; }
  #app .feed-column > .compose-card { grid-area: 3 / 1; }
  #app #feed-trends { grid-area: 4 / 1; }
  #app .feed-heading { grid-area: 5 / 1; }
  #app #feed-list { grid-area: 6 / 1; }
  #app #feed-empty { grid-area: 7 / 1; }
  #app #feed-more { grid-area: 8 / 1; }
  #app #feed-skills { grid-area: 7 / 2 / 9 / 3; }
  #app .feed-column > .g-footer { grid-column: 1 / -1; }
}

/* Profile: compact identity, real activity stats, highlights and a media-first grid. */
body[data-view="profile"] #app .topbar .top-brand { display: none; }
body[data-view="profile"] #app .topbar #view-title {
  display: block; visibility: visible; flex: 1; min-width: 0; margin: 0; font-size: .875rem;
  line-height: 1.4; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body[data-view="profile"] #app .view-actions { margin-left: auto; }
#app #profile-view .profile-column { display: grid; gap: 0; width: 100%; max-width: 960px; padding-top: 16px; }
#app #profile-head { display: grid; gap: 12px; margin-bottom: 12px; min-width: 0; }
#app #profile-view .p-card {
  display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center;
  gap: 12px 16px; padding: 0; border: 0; border-radius: 0; background: transparent;
}
#app #profile-view .p-photo { width: 80px; align-self: start; margin-top: 4px; }
#app #profile-view .p-ring { padding: 0; border: 0; background: transparent; }
#app #profile-view .p-ring .avatar.xl { width: 80px; height: 80px; min-width: 80px; font-size: 1.75rem; border-radius: 50%; }
#app #profile-view .p-cam {
  width: 44px; height: 44px; right: -10px; bottom: -8px;
  padding: 10px; border: 0; background: transparent; color: var(--text);
}
#app #profile-view .p-cam .icon { width: 24px; height: 24px; padding: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 50%; }
#app #profile-view .p-info { display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 6px 8px; padding: 0; }
#app #profile-view .p-name { width: 100%; margin: 0; font-size: .875rem; line-height: 1.4; font-weight: 600; letter-spacing: 0; gap: 6px; }
#app #profile-view .p-online { width: 6px; height: 6px; }
#app #profile-view .p-pills { gap: 4px; }
#app #profile-view .p-pills .pill { padding: 2px 6px; font-size: .6875rem; line-height: 1.4; }
#app #profile-view .p-statbar { width: 100%; flex: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; gap: 8px; }
#app #profile-view .ps-item { display: block; padding: 0; border: 0; }
#app #profile-view .ps-text { display: grid; gap: 2px; justify-items: start; text-align: left; line-height: 1.3; }
#app #profile-view .ps-text strong { font-family: inherit; font-size: 1rem; font-weight: 600; }
#app #profile-view .ps-text span { font-size: .75rem; line-height: 1.4; white-space: normal; overflow: visible; }
#app #profile-view .p-bio-block { grid-column: 1 / -1; display: grid; gap: 4px; min-width: 0; }
#app #profile-view .p-handle { margin: 0; font-size: .75rem; }
#app #profile-view .p-bio { font-size: .875rem; line-height: 1.45; font-weight: 400; white-space: pre-wrap; }
#app #profile-view .p-joined { margin-top: 4px; font-size: .75rem; line-height: 1.4; gap: 6px; }
#app #profile-view :is(.p-level, .p-joined) .icon { width: 14px; height: 14px; color: var(--muted); }
#app #profile-view .p-level { padding: 0; margin: 0; gap: 6px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 400; }
#app #profile-view .access-badge { font-size: .6875rem; padding: 2px 6px; line-height: 1.4; }
#app #profile-view .access-detail { display: none; }
#app #profile-view .p-dashboard {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 10px 12px; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
#app #profile-view .p-dashboard > span { display: grid; gap: 2px; }
#app #profile-view .p-dashboard strong { font-size: .875rem; font-weight: 600; }
#app #profile-view .p-dashboard span span { font-size: .75rem; color: var(--muted); }
#app #profile-view .p-buttons { display: grid; margin: 0; gap: 8px; }
#app #profile-view .p-buttons-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#app #profile-view .p-buttons:has(> button:only-child) { grid-template-columns: minmax(0, 1fr); justify-items: end; }
#app #profile-view .p-btn { min-width: 0; min-height: 44px; padding: 8px 12px; gap: 6px; border-radius: 8px; font-size: .875rem; line-height: 1.35; }
#app #profile-view .p-btn .icon { width: 18px; height: 18px; }
#app #profile-view .p-shortcuts { display: flex; gap: 16px; overflow-x: auto; padding: 4px 0; scrollbar-width: thin; }
#app #profile-view .p-shortcut { display: grid; justify-items: center; flex: 0 0 68px; gap: 6px; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: .75rem; line-height: 1.35; }
#app #profile-view .p-shortcut-ring { display: grid; place-items: center; width: 64px; height: 64px; padding: 4px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--panel); }
#app #profile-view .p-shortcut-ring .icon { width: 24px; height: 24px; stroke-width: 1.8; }
#app #profile-view .profile-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 56px; border-bottom: 1px solid var(--border); }
#app #profile-view .profile-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; }
#app #profile-view .profile-tabs .icon { width: 24px; height: 24px; }
#app #profile-view .profile-tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; }
#app #profile-view .profile-tabs button[aria-selected="true"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--text); }
#app #profile-view #profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0; width: 100%; border-radius: 0; }
#app #profile-view .thumb { min-width: 0; min-height: 0; aspect-ratio: 3 / 4; border-radius: 0; }
#app #profile-view .thumb img { object-fit: cover; }
#app #profile-view .thumb-text { display: grid; align-content: center; padding: 12px; font-family: inherit; font-size: .8125rem; line-height: 1.4; font-weight: 500; }
#app #profile-view .thumb-stats { inset: auto 0 0; display: block; padding: 16px 8px 6px; background: linear-gradient(transparent, #0009); font-size: .6875rem; font-weight: 500; opacity: 1; text-align: left; }
#app #profile-view #profile-about-panel:not([hidden]) { display: grid; gap: 12px; padding-top: 16px; }
#app #profile-view #profile-about-panel > div:empty { display: none; }
#app #profile-view #profile-about-panel :is(.lj-card, .m-profile) { margin: 0; }
#app #profile-view #profile-more { margin-top: 16px; }
@media (max-width: 767px) {
  #app #profile-view .profile-column { padding: 12px 12px 24px; }
  #app #profile-view :is(.profile-tabs, #profile-posts-panel) { margin-inline: -12px; width: calc(100% + 24px); }
  #app #profile-view #profile-empty, #app #profile-view #profile-more { margin-inline: 12px; width: calc(100% - 24px); }
}
@media (min-width: 768px) {
  #app #profile-view .profile-column { padding-top: 24px; }
  #app #profile-view .p-card { grid-template-columns: 96px minmax(0, 1fr); gap: 16px 24px; }
  #app #profile-view .p-photo, #app #profile-view .p-ring .avatar.xl { width: 96px; height: 96px; }
  #app #profile-view .p-info { max-width: 480px; }
  #app #profile-view .p-name { font-size: 1rem; }
  #app #profile-view .ps-text strong { font-size: 1.125rem; }
  #app #profile-view .ps-text span { font-size: .875rem; }
  #app #profile-view .p-bio-block { max-width: 65ch; }
  #app #profile-view .p-dashboard { max-width: 560px; }
  #app #profile-view .p-buttons { max-width: 560px; }
  #app #profile-view .p-shortcuts { padding-block: 8px; }
  #app #profile-view #profile-about-panel:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  #app #profile-view #profile-impact { grid-column: 1 / -1; }
}
