/* FANSFLEX v10.0 - Feed and Profile state polish.
   Route-scoped presentation only; existing permission, payment and pagination APIs remain intact. */
body.ff-route-profile, body.ff-route-feed {
  --ff100-panel: var(--ff-panel, #10283b);
  --ff100-panel-soft: var(--ff-panel-soft, #153148);
  --ff100-line: var(--ff-line, #35516b);
  --ff100-text: var(--ff-text, #f1f5fa);
  --ff100-muted: var(--ff-muted, #afc0d0);
  --ff100-amber: #e7be76;
  --ff100-amber-text: #182739;
}
html[data-bs-theme="light"] body:is(.ff-route-profile,.ff-route-feed),
html[data-theme="light"] body:is(.ff-route-profile,.ff-route-feed) {
  --ff100-panel: #fff;
  --ff100-panel-soft: #f4f7fa;
  --ff100-line: #d4dee7;
  --ff100-text: #17334a;
  --ff100-muted: #5e7080;
  --ff100-amber: #b17c36;
  --ff100-amber-text: #172a3c;
}
html[data-bs-theme="dark"] body:is(.ff-route-profile,.ff-route-feed),
html[data-theme="dark"] body:is(.ff-route-profile,.ff-route-feed),
html[data-bs-theme="night"] body:is(.ff-route-profile,.ff-route-feed) {
  --ff100-panel: #10283e;
  --ff100-panel-soft: #19364e;
  --ff100-line: #37536b;
  --ff100-text: #f0f5f9;
  --ff100-muted: #b6c9da;
  --ff100-amber: #e7be76;
  --ff100-amber-text: #142534;
}
/* The context surface is server-rendered and only shows actions allowed by current server rules. */
body.ff-route-profile .ff100-profile-context {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 13px 18px;
  margin: 11px 20px 14px;
  border: 1px solid var(--ff100-line);
  border-radius: 14px;
  color: var(--ff100-text);
  background: linear-gradient(137deg,var(--ff100-panel-soft),var(--ff100-panel));
  box-shadow: 0 9px 22px rgba(4,17,30,.11), inset 0 1px 0 rgba(255,255,255,.09);
}
body.ff-route-profile .ff100-profile-context.is-owner {border-inline-start: 3px solid var(--ff100-amber)}
body.ff-route-profile .ff100-context-icon {
  display:grid;place-items:center;
  flex:0 0 40px;width:40px;height:40px;
  border-radius:12px;border:1px solid var(--ff100-line);
  background:linear-gradient(140deg,rgba(231,190,118,.2),transparent);
  color:var(--ff100-amber);font-size:21px;
}
body.ff-route-profile .ff100-context-copy {min-width:0;flex:1 1 160px}
body.ff-route-profile .ff100-context-copy strong {display:block;font-weight:800;font-size:13px;line-height:1.35;color:var(--ff100-text)}
body.ff-route-profile .ff100-context-copy p {
  font-size:12px;line-height:1.45;margin:3px 0 0;
  color:var(--ff100-muted);overflow-wrap:anywhere;
}
body.ff-route-profile .ff100-context-actions {display:flex;align-items:center;flex-wrap:wrap;gap:7px;justify-content:flex-end;min-width:0}
body.ff-route-profile .ff100-context-link {
  display:inline-flex;align-items:center;justify-content:center;text-align:center;
  min-height:36px;padding:7px 12px;border-radius:9px;
  border:1px solid var(--ff100-line);background:var(--ff100-panel);
  color:var(--ff100-text);font-size:11px;font-weight:800;
  line-height:1.2;text-decoration:none;max-width:100%;overflow-wrap:anywhere;
}
body.ff-route-profile .ff100-context-link:hover {border-color:var(--ff100-amber);color:var(--ff100-text);text-decoration:none}
body.ff-route-profile .ff100-context-link.is-primary {
  background:linear-gradient(155deg,#f7d997,var(--ff100-amber));
  color:var(--ff100-amber-text);border-color:#c29d5c;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 3px 9px rgba(5,17,28,.17);
}
body.ff-route-profile #ff100-profile-content {min-width:0;scroll-margin-top:80px}
/* Published owner posts, not private viewer data. Existing action menu remains authoritative. */
body:is(.ff-route-feed,.ff-route-profile) .ff100-post-owner-label {
  display:inline-flex;align-items:center;gap:5px;max-width:100%;
  color:var(--ff100-amber);font-size:10px;font-weight:750;
  letter-spacing:.01em;line-height:1.3;
}
body:is(.ff-route-feed,.ff-route-profile) .ff100-post-owner-label ion-icon{font-size:13px;flex-shrink:0}
body:is(.ff-route-feed,.ff-route-profile) .post-box,
body.ff-route-profile .profile-compact-post-tile {min-width:0}
body:is(.ff-route-feed,.ff-route-profile) .post-box .post-details,
body:is(.ff-route-feed,.ff-route-profile) .post-box .post-content-data,
body.ff-route-profile .profile-description-holder,
body.ff-route-profile .profile-social-links {min-width:0;overflow-wrap:anywhere;word-break:normal}
body.ff-route-profile .profile-content-tabs-nav,
body.ff-route-profile .profile-media-filter-pills {min-width:0}
body.ff-route-profile .profile-compact-post-tile img {object-fit:cover}
/* Clear and readable state panels, including network failures / retries. */
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] {min-width:0;max-width:100%;overflow-wrap:anywhere}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state {
  border:1px solid var(--ff100-line);border-radius:15px;
  background:linear-gradient(150deg,var(--ff100-panel-soft),var(--ff100-panel));
  color:var(--ff100-text);max-width:100%;min-width:0;
  margin:12px 12px 18px;padding:28px 15px!important;
}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-title{color:var(--ff100-text);font-size:16px}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-copy{color:var(--ff100-muted)!important;max-width:440px;overflow-wrap:anywhere}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions {gap:8px;min-width:0}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions .btn {min-height:38px;white-space:normal;text-align:center}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-illustration {
  display:block;max-width:min(170px,55vw);max-height:150px;object-fit:contain;
}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions .btn-primary {
  background:linear-gradient(155deg,#ffe6b0,#d9ac5e)!important;
  border:1px solid #c49b59!important;color:#16283a!important;font-weight:800;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.38),0 4px 10px rgba(0,0,0,.12);
}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions .btn-outline-secondary,
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions .btn-outline-primary {
  color:var(--ff100-text)!important;border-color:var(--ff100-line)!important;
  background:var(--ff100-panel-soft)!important;font-weight:750;
}
body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state-actions a:hover {
  filter:brightness(1.08);text-decoration:none;
}
body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-error {
  max-width:100%;margin:12px;padding:22px!important;
  border:1px solid #bd826a;border-radius:14px;
  background:linear-gradient(140deg,rgba(200,109,72,.14),var(--ff100-panel));
  color:var(--ff100-text);overflow-wrap:anywhere;
}
body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-error p {color:var(--ff100-text);font-size:13px;font-weight:650;line-height:1.5}
body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-error button {
  min-height:38px;padding:7px 15px;border:1px solid var(--ff100-line);border-radius:9px;
  background:var(--ff100-panel-soft);color:var(--ff100-text);font-weight:750;
}
body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-error button:hover{border-color:var(--ff100-amber)}
body:is(.ff-route-feed,.ff-route-profile) .ff100-loading-content,
body.ff-route-profile .ff100-reels-pending {align-items:center;justify-content:center;gap:11px;color:var(--ff100-muted);font-size:12px;font-weight:700}
body:is(.ff-route-feed,.ff-route-profile) .ff100-loading-content:not(.d-none){display:flex}
body.ff-route-profile .ff100-reels-pending {display:flex;min-height:170px;flex-wrap:wrap}
body:is(.ff-route-feed,.ff-route-profile) .posts-wrapper[aria-busy="true"] {min-height:84px}
body:is(.ff-route-feed,.ff-route-profile) .reverse-paginate-btn button:disabled {cursor:wait;opacity:.6}
/* True keyboard focus - no fake click areas; respect reduced-motion preferences. */
body:is(.ff-route-feed,.ff-route-profile) :is(.ff100-context-link,.ff100-posts-retry,.ff100-reels-retry,
  .post-box .dropdown-toggle,.profile-content-tabs a,.profile-media-filter-pills a):focus-visible {
  outline:3px solid var(--ff100-amber)!important;outline-offset:3px;box-shadow:0 0 0 5px rgba(231,190,118,.13)!important;
}
@media(max-width:850px){
  body.ff-route-profile .ff100-profile-context{align-items:flex-start;flex-wrap:wrap;gap:10px}
  body.ff-route-profile .ff100-context-actions{width:100%;justify-content:flex-start;padding-inline-start:50px}
}
@media(max-width:480px){
  body.ff-route-profile .ff100-profile-context{margin:10px 12px 12px;padding:12px;gap:9px;border-radius:12px}
  body.ff-route-profile .ff100-context-icon{flex-basis:34px;width:34px;height:34px;font-size:18px}
  body.ff-route-profile .ff100-context-copy {flex-basis:calc(100% - 44px)}
  body.ff-route-profile .ff100-context-actions{padding-inline-start:0}
  body.ff-route-profile .ff100-context-link{flex:1 1 auto;min-height:42px}
  body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-error {margin:9px;padding:15px!important}
  body:is(.ff-route-feed,.ff-route-profile) [data-posts-empty-state] .app-empty-state{margin:9px;padding:24px 13px!important}
}
@media (prefers-reduced-motion:reduce){
  body:is(.ff-route-feed,.ff-route-profile) .ff100-context-link,
  body:is(.ff-route-feed,.ff-route-profile) .ff100-posts-retry {transition:none!important;animation:none!important}
}
