/* Phase 1: shared primitives and dashboard. Keep native widget behavior intact. */
.loop-shell {font-family:var(--loop-font);font-size:15px;line-height:1.5;background:var(--loop-bg);color:var(--loop-text);}
.loop-shell::before,.loop-shell::after {display:none;content:none;}
.loop-shell :where(button,input,select,textarea) {font-family:inherit;}
.loop-shell :where(a,button,input,textarea,select,[tabindex]):focus-visible {outline:2px solid var(--loop-accent);outline-offset:3px;}
.loop-shell :where(button,a,.btn) {touch-action:manipulation;}
.loop-shell :where(button,.btn) {transition:background-color var(--loop-speed) var(--loop-ease),color var(--loop-speed) var(--loop-ease),border-color var(--loop-speed) var(--loop-ease);}
.loop-shell :where(.panel,.card,.modal-content,.dropdown-menu) {border-radius:var(--loop-radius-lg);border-color:var(--loop-border);}
.loop-shell .dropdown-menu {padding:8px;box-shadow:var(--loop-shadow);}
.loop-shell .dropdown-menu .dropdown-item {border-radius:var(--loop-radius-sm);padding:10px 12px;}
.loop-shell .dropdown-item:hover,.loop-shell .dropdown-item:focus {background:var(--loop-raised);color:var(--loop-text);}
.loop-shell :where(.btn,.form-control,.form-select) {border-radius:var(--loop-radius-sm);font-size:14px;}
.loop-shell .btn {font-weight:600;min-height:36px;}
.loop-shell .btn-primary {background:var(--loop-accent);border-color:var(--loop-accent);color:var(--loop-bg);}
.loop-shell .btn-primary:hover,.loop-shell .btn-primary:focus-visible {filter:brightness(1.08);color:var(--loop-bg);}
.loop-shell :where(.form-control,.form-select):focus {border-color:var(--loop-accent);box-shadow:var(--loop-focus);}
.loop-shell :where(input,textarea)::placeholder {color:var(--loop-muted);opacity:1;}
.loop-shell :where(.nav-tabs,.nav-pills) {border-color:var(--loop-border);}
.loop-shell .nav-tabs .nav-link {padding:12px 16px;font-weight:600;}
.loop-shell .nav-tabs .nav-link.active {color:var(--loop-text);background:var(--loop-soft);}

/* Borderless stroke navigation, calm header and a clearly bounded search field. */
.loop-shell #topbar-first {height:68px;padding:0 max(24px,calc((100vw - 1360px)/2));gap:20px;background:var(--loop-header);border-bottom:1px solid var(--loop-border);}
.loop-brand {min-width:130px;}
.loop-brand img {width:130px;height:44px;object-fit:contain;}
.loop-primary-nav {gap:6px;}
.loop-shell .loop-primary-nav>a {width:40px;height:44px;border-radius:var(--loop-radius-sm);background:transparent!important;box-shadow:none;color:var(--loop-muted);}
.loop-shell .loop-primary-nav>a:hover {background:var(--loop-raised)!important;color:var(--loop-text);}
.loop-shell .loop-primary-nav>a.is-active {color:var(--loop-accent);}
.loop-primary-nav svg,.loop-header-button svg {stroke-width:1.9;width:23px;height:23px;}
.loop-shell .loop-global-search {max-width:350px;min-width:150px;}
.loop-global-search form {height:42px;border:1px solid var(--loop-border);border-radius:var(--loop-radius-pill);background:var(--loop-raised);}
.loop-shell .loop-global-search input {font-family:var(--loop-font);font-size:14px;height:38px;}
.loop-global-search input::placeholder {color:var(--loop-muted);}
.loop-shell .loop-global-search button {min-height:36px;min-width:36px;}
.loop-search-suggestions {border-radius:var(--loop-radius-md);}
.loop-shell .loop-header-button {border:0!important;border-radius:var(--loop-radius-sm);background:transparent!important;min-width:40px;min-height:40px;}

/* Feed gets the majority of usable width; rails stay readable, never squeezed. */
.loop-shell #main-content:has(.loop-dashboard) {padding:92px 24px 48px;}
.loop-dashboard {max-width:1360px;margin-inline:auto;grid-template-columns:220px minmax(0,1fr) 270px;gap:24px;}
.loop-dashboard .loop-profile-column,.loop-dashboard .loop-discovery-column {top:92px;}
.loop-dashboard .loop-profile-shortcuts {margin-top:20px;padding:0 8px;font-size:13px;}
.loop-dashboard .loop-profile-footer {margin:24px 8px 0;font-size:11px;}
.loop-dashboard .loop-profile-footer>span {font-size:12px;margin-bottom:8px;}
.loop-social-rail {gap:16px;}
.loop-social-rail>section,.loop-social-rail>details {padding:18px;border-radius:var(--loop-radius-lg);background:var(--loop-surface);border:1px solid var(--loop-border);}
.loop-social-rail h2 {font-size:18px;font-weight:650;letter-spacing:-.3px;line-height:1.35;}
.loop-social-rail .loop-rail-heading {margin-bottom:14px;}
.loop-social-rail p {font-size:13px;line-height:1.65;}
.loop-social-rail .loop-premium-callout .btn {width:100%;font-size:13px;padding:9px 12px;}
.loop-social-rail .loop-hashtags {gap:7px;justify-content:flex-start;}
.loop-social-rail .loop-hashtags a {font-size:12px;padding:5px 9px;border-color:var(--loop-border);background:transparent;color:var(--loop-muted);}
.loop-social-rail .loop-hashtags a:hover {border-color:var(--loop-accent);color:var(--loop-accent);}
.loop-social-rail .loop-news-item {padding:12px 0;}
.loop-social-rail .loop-follow-suggestion img {width:36px;height:36px;}

.loop-dashboard .loop-stories {min-height:98px;margin-bottom:8px;}
.loop-dashboard .loop-story-row {gap:16px;padding-bottom:8px;min-height:98px;scroll-snap-type:x proximity;overscroll-behavior-inline:contain;}
.loop-story-row:focus-visible {border-radius:var(--loop-radius-sm);outline-offset:4px;}
.loop-dashboard .loop-story-ring {width:60px;height:60px;padding:3px;border-width:2px;border-color:var(--loop-border);}
.loop-dashboard .loop-story-ring img {width:50px;height:50px;}
.loop-dashboard .loop-story-ring.has-story {border-color:var(--loop-accent);}
.loop-dashboard .loop-story-link,.loop-dashboard .loop-person-orbit,.loop-dashboard .loop-own-story {width:64px;flex-basis:64px;scroll-snap-align:start;}
.loop-dashboard .loop-story-link>span:last-child {font-size:11px;width:64px;}
.loop-dashboard .loop-feed-tabs {margin:0 0 16px;padding:0;gap:0;}
.loop-dashboard .loop-feed-tabs a {flex:1;text-align:center;font-size:14px;padding:12px;color:var(--loop-muted);min-height:46px;}
.loop-dashboard .loop-feed-tabs a.is-active {color:var(--loop-text);border-color:var(--loop-accent);}
.loop-shell .loop-dashboard .loop-compose-bar {margin-bottom:18px;border:1px solid var(--loop-border);border-radius:var(--loop-radius-lg);background:var(--loop-surface);padding:12px 14px;min-height:62px;}
.loop-dashboard .loop-compose-launch>span:last-child {color:var(--loop-muted);}
.loop-dashboard .wall-entry {border:1px solid var(--loop-border)!important;border-radius:var(--loop-radius-lg)!important;margin-bottom:18px;background:var(--loop-surface);box-shadow:none!important;}
.loop-dashboard .wall-entry>.panel-body {padding:18px 20px;}
.loop-shell .loop-dashboard .wall-entry-header h4 {font-size:15px;font-weight:650;line-height:1.45;margin-bottom:3px;}
.loop-shell .loop-dashboard .wall-entry-header h5 {font-size:12px;color:var(--loop-muted);}
.loop-dashboard .wall-entry-content {font-size:15px;line-height:1.65;}
.loop-dashboard .wall-entry-content p {margin-bottom:12px;}
.loop-dashboard .wall-entry-links {padding-top:12px;margin-top:12px;gap:18px;min-height:44px;}
.loop-dashboard .wall-entry-links :where(a,button) {min-height:36px;}
.loop-dashboard .loop-post-media-1:has(img) {aspect-ratio:4/3;display:block;background:var(--loop-bg);}
.loop-dashboard .loop-post-media-1:has(img) .loop-post-media-tile,.loop-dashboard .loop-post-media-1:has(img) .loop-post-media-tile>a {height:100%;}
.loop-dashboard .loop-post-media-1:has(img) .loop-post-media-tile img {height:100%!important;max-height:none!important;object-fit:contain;}

/* Native loading state, not mock posts: disappears with the stream's own loader. */
.loop-dashboard .s2_streamContent:has(>.loader):not(:has(.wall-entry)) {min-height:320px;}
.loop-dashboard .s2_streamContent:has(>.loader):not(:has(.wall-entry))::before {
  content:'';display:block;height:280px;border:1px solid var(--loop-border);border-radius:var(--loop-radius-lg);
  background:linear-gradient(var(--loop-raised),var(--loop-raised)) 20px 24px/42px 42px no-repeat,
    linear-gradient(var(--loop-raised),var(--loop-raised)) 76px 28px/36% 12px no-repeat,
    linear-gradient(var(--loop-raised),var(--loop-raised)) 76px 50px/24% 8px no-repeat,
    linear-gradient(var(--loop-raised),var(--loop-raised)) 20px 94px/84% 12px no-repeat,
    linear-gradient(var(--loop-raised),var(--loop-raised)) 20px 120px/65% 12px no-repeat,
    linear-gradient(var(--loop-raised),var(--loop-raised)) 20px 158px/calc(100% - 40px) 98px no-repeat,var(--loop-surface);
}
.loop-social-rail [data-loop-news-items] {min-height:220px;}
.loop-mobile-nav a[aria-current=page] {color:var(--loop-accent);}
@media(min-width:1500px) {.loop-dashboard {grid-template-columns:232px minmax(0,1fr) 288px;gap:28px;}}
@media(max-width:1180px) {
  .loop-dashboard {max-width:960px;grid-template-columns:200px minmax(0,1fr);gap:24px;}
  .loop-dashboard .loop-discovery-column {display:none;}
  .loop-shell #topbar-first {gap:12px;padding-inline:20px;}
  .loop-primary-nav {gap:2px;}.loop-shell .loop-primary-nav>a {width:34px;}
  .loop-brand {min-width:108px;}.loop-brand img {width:108px;}
}
@media(max-width:900px) {
  .loop-dashboard {display:block;max-width:720px;}
  .loop-dashboard .loop-profile-column {display:none;}
  .loop-primary-nav {display:none;}.loop-shell .loop-global-search {max-width:none;}
  .loop-mobile-nav {display:flex;padding-top:9px;background:var(--loop-header);border-color:var(--loop-border);}
  .loop-shell #main-content:has(.loop-dashboard) {padding-bottom:100px;}
  .loop-chat-dock {bottom:88px;}
}
@media(max-width:700px) {
  .loop-shell #topbar-first:has(.loop-global-search) {height:116px;padding:8px 16px;gap:6px 12px;}
  .loop-shell .loop-global-search {flex-basis:100%;order:3;}
  .loop-global-search form {height:40px;}.loop-shell .loop-global-search input {font-size:16px;}
  .loop-shell #main-content:has(.loop-dashboard) {padding:132px 12px 100px!important;}
  .loop-dashboard .wall-entry>.panel-body {padding:16px;}
  .loop-dashboard .wall-entry-content {font-size:15px;}
  .loop-dashboard .wall-entry {margin-bottom:12px;}
  .loop-mobile-nav {gap:0;padding-inline:6px;}.loop-mobile-nav a {min-width:44px;min-height:44px;}
  .loop-dashboard .loop-stories {margin-bottom:0;}
  .loop-shell .loop-dashboard .loop-compose-bar {padding:10px 12px;margin-bottom:14px;}
  .loop-shell .loop-dashboard .loop-compose-launch {font-size:14px;}
  .loop-dashboard .loop-post-media-1:has(img) {aspect-ratio:4/5;}
}
@media(prefers-reduced-motion:reduce) {
  .loop-shell :where(button,a,.btn) {transition:none!important;}
  .loop-shell {scroll-behavior:auto;}
}
html[data-loop-motion=reduce] .loop-shell :where(button,a,.btn) {transition:none!important;}
/* Long discovery rails scroll naturally rather than shifting down with relative top. */
.loop-dashboard .loop-discovery-column:has(.loop-news-section){position:static;top:auto}
.loop-shell #topbar-first .loop-primary-nav svg,.loop-shell #topbar-first .loop-header-button svg{width:23px;height:23px;stroke-width:1.9}
/* Facebook + X hybrid dashboard navigation, using existing destinations only. */
.loop-side-navigation{display:grid;gap:4px}
.loop-side-eyebrow{font-size:11px;letter-spacing:1.4px;font-weight:650;color:var(--loop-muted);padding:4px 14px 12px}
.loop-side-navigation>a{display:flex;align-items:center;gap:14px;min-height:46px;padding:10px 14px;border-radius:var(--loop-radius-md);color:var(--loop-muted);font-size:15px;font-weight:550;text-decoration:none}
.loop-side-navigation>a svg{width:22px;height:22px;stroke-width:1.9}
.loop-side-navigation>a:hover{background:var(--loop-surface);color:var(--loop-text)}
.loop-side-navigation>a[aria-current=page]{background:var(--loop-soft);color:var(--loop-accent);font-weight:650}
.loop-side-navigation>a.loop-side-premium{margin-top:12px;border:1px solid var(--loop-border);color:var(--loop-accent);justify-content:center;font-size:14px}
.loop-sidebar-account{display:flex;align-items:center;gap:10px;border-top:1px solid var(--loop-border);margin-top:20px;padding:18px 8px 0;text-decoration:none!important;color:var(--loop-text)!important;min-width:0}
.loop-sidebar-account>img{border-radius:50%;flex:none}.loop-sidebar-account>span{flex:1;min-width:0}
.loop-sidebar-account strong,.loop-sidebar-account small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.loop-sidebar-account strong{font-size:13px;font-weight:600}.loop-sidebar-account small{font-size:12px;color:var(--loop-muted)}.loop-sidebar-account>svg{width:15px;height:15px;color:var(--loop-muted)}
.loop-dashboard .loop-profile-shortcuts{margin-top:24px}.loop-dashboard .loop-profile-footer{margin-top:20px}
/* Rich posts keep room for media; short conversations stay compact. */
.loop-dashboard .wall-entry>.panel>.panel-body{padding:18px 20px}
.loop-dashboard .wall-entry:not(:has(video,audio,.loop-post-media-grid,.loop-link-card,.loop-repost-card,.loop-post-music))>.panel>.panel-body{padding:14px 20px}
.loop-dashboard .wall-entry:not(:has(video,audio,.loop-post-media-grid,.loop-link-card,.loop-repost-card,.loop-post-music)) .wall-entry-header{margin-bottom:12px}
.loop-dashboard .loop-post-media-grid{margin-top:14px}
.loop-dashboard .wall-entry-links{font-variant-numeric:tabular-nums}
@media(max-width:700px){.loop-dashboard .wall-entry>.panel>.panel-body,.loop-dashboard .wall-entry:not(:has(video,audio,.loop-post-media-grid,.loop-link-card,.loop-repost-card,.loop-post-music))>.panel>.panel-body{padding:16px}}
.loop-dashboard .loop-profile-column{max-height:calc(100dvh - 112px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--loop-border) transparent}

/* Keep the sidebar scrollable without a visible scrollbar. */
.loop-shell .loop-dashboard .loop-profile-column{scrollbar-width:none;-ms-overflow-style:none}
.loop-shell .loop-dashboard .loop-profile-column::-webkit-scrollbar{display:none;width:0;height:0}

/* Desktop feed: compact cards, with the actions immediately after the media. */
@media(min-width:901px){
  .loop-shell .loop-dashboard .wall-entry{margin-bottom:12px}
  .loop-shell .loop-dashboard .wall-entry>.panel>.panel-body,
  .loop-shell .loop-dashboard .wall-entry>.panel-body{padding:12px 16px}
  .loop-shell .loop-dashboard .wall-entry .wall-entry-header{margin-bottom:10px;padding-bottom:0;min-height:40px}
  .loop-shell .loop-dashboard .wall-entry .wall-entry-content{margin-bottom:0;line-height:1.5}
  .loop-shell .loop-dashboard .wall-entry .wall-entry-content p{margin-bottom:8px}
  .loop-shell .loop-dashboard .wall-entry .wall-entry-footer{margin-top:0;padding-top:0}
  .loop-shell .loop-dashboard .wall-entry-footer>.stream-entry-addons>.wall-entry-controls.wall-entry-links{margin-top:0;padding-top:0;min-height:44px;gap:16px}
  .loop-shell .loop-dashboard .wall-entry-footer>.stream-entry-addons>.wall-entry-controls.wall-entry-links>a,
  .loop-shell .loop-dashboard .wall-entry-footer>.stream-entry-addons>.wall-entry-controls.wall-entry-links>button{min-height:44px}
  .loop-shell .loop-dashboard .loop-post-media-grid{margin-top:8px;margin-bottom:0}
  .loop-shell .loop-dashboard .wall-entry-footer>.stream-entry-addons>.loop-post-media-grid,
  .loop-shell .loop-dashboard .wall-entry-footer>.stream-entry-addons>.loop-photo-soundtrack{margin:8px -16px 0;width:calc(100% + 32px);border-radius:0}
  .loop-shell .loop-dashboard .loop-photo-soundtrack>.loop-post-media-grid{margin:0;width:100%;border-radius:0}
  .loop-shell .loop-dashboard .loop-video-stage{margin:8px -16px 0;width:calc(100% + 32px)}
  .loop-shell .loop-dashboard .loop-video-stage .loop-reel-player{height:min(62vh,560px)}
}
/* Mobile audit: touchable controls without changing the desktop shell. */
@media(max-width:700px){
 .loop-shell #topbar-first .loop-header-button,
 .loop-shell #topbar-first #account-dropdown-link,
 .loop-shell #topbar-first #icon-notifications,
 .loop-shell #topbar-first .loop-camera-profile{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:9px!important}
 .loop-shell .loop-top-actions{gap:4px}
 .loop-mobile-nav>a{min-height:48px}
 .loop-shell .wall-entry-links .likeAnchor,
 .loop-shell .wall-entry-links>a{min-height:44px;display:inline-flex;align-items:center}
 .loop-shell .form-control{font-size:16px}
 .loop-shell .loop-notification-heading button,
 .loop-shell .loop-alert-options summary{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
}

/* Post-only compact sizing: preserve the shell, typography and control sizes. */
@media(min-width:901px){
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry{width:100%;max-width:680px;margin-inline:auto}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry>.panel>.panel-body,
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry>.panel-body{padding:10px 16px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .wall-entry-header{margin-bottom:6px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .wall-entry-header h4{margin-bottom:2px;padding-top:0}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .wall-entry-header h5{margin-bottom:0}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .wall-entry-content p{margin-bottom:4px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .wall-entry-content p:last-child{margin-bottom:0}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-grid:not(.loop-post-media-1){max-height:560px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1:has(img){max-height:480px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-video-stage .loop-reel-player{height:min(55vh,480px)}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1 video{max-height:480px!important}
}

/* Post card sizing publication: 2026-11-01. */

/* Match in-feed discovery shelves to the compact post cards. */
@media(min-width:901px){
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) :is(.loop-reels-shelf,.loop-suggestion-shelf){box-sizing:border-box;width:100%;max-width:680px;margin-inline:auto}
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) :is(.loop-reels-preview,.loop-reels-create-preview){flex-basis:168px}
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) .loop-suggestion-card{flex-basis:172px;padding:20px 10px 12px}
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) .loop-suggestion-profile>img{width:64px;height:64px}
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) .loop-suggestion-card.is-group{flex-basis:192px;padding-top:0}
 .loop-shell #layout-content :is(.loop-feed-column,.loop-member-feed) .loop-suggestion-cover{width:calc(100% + 20px)}
}

/* Shared geometric centering for gallery, chat and navigation chevrons. */
.loop-shell .loop-gallery-arrow,.loop-shell .loop-chat-dock[data-view=compose] .loop-chat-dock-head>[data-chat-inbox]{display:grid;place-items:center;padding:0;line-height:1}
.loop-shell .loop-gallery-arrow>svg,.loop-shell .loop-chat-dock-head>[data-chat-inbox]>svg{display:block;width:22px;height:22px;flex-shrink:0}
.loop-shell .loop-market-sidebar nav[aria-label="Marketplace categories"]>a>span[aria-hidden=true],.loop-shell .loop-ad-identity-row>span[aria-hidden=true]:last-child{display:grid;place-items:center;flex-shrink:0;line-height:1}
.loop-shell .loop-market-sidebar nav[aria-label="Marketplace categories"]>a>span[aria-hidden=true]>svg,.loop-shell .loop-ad-identity-row>span[aria-hidden=true]:last-child>svg{display:block;width:20px;height:20px}

/* Location tags retain Loop branding inside feed author headers. */
.loop-shell .wall-entry .wall-entry-header h4 .loop-post-place>a{color:var(--loop-accent);font-weight:500}

/* Brand purple for post content links and author/location links; metadata keeps its hierarchy. */
.loop-shell .wall-entry .wall-entry-content a[href]:not(.btn):not([role="button"]),
.loop-shell .wall-entry .wall-entry-header h4 a[href]:not(.btn):not([role="button"]){color:var(--loop-accent)}

/* Desktop single photos use their own proportions, with a larger portrait limit. */
@media(min-width:901px){
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1:has(img){aspect-ratio:auto;height:auto;max-height:700px}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1:has(img) .loop-post-media-tile{height:auto}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1:has(img) .loop-post-media-tile>a{display:flex;justify-content:center;align-items:center;height:auto}
 .loop-shell #layout-content :is(.loop-dashboard,.loop-profile-premium) .wall-entry .loop-post-media-1:has(img) .loop-post-media-tile img{display:block;width:auto!important;height:auto!important;max-width:100%!important;max-height:700px!important;object-fit:contain}
}
