/* Sidebar status */
.header-action.nav-item.profile-shortcut { border-radius: 50%; }
.sidebar-status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; }
.sidebar-status-card { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-card); }
.sidebar-status-card > i { color: var(--accent); font-size: .85rem; }
.sidebar-status-card div { min-width: 0; }
.sidebar-status-label { display: block; color: var(--text-dim); font-size: .59rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-status-value { display: block; margin-top: 2px; overflow: hidden; color: var(--text); font-size: .74rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.nav-list { min-height: 0; }

/* Profile customization */
.profile-trigger { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.msg-author-name.profile-trigger:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.member-profile-dialog { width: min(92vw, 380px); overflow-wrap: anywhere; }
.member-profile-avatar { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--profile-accent); overflow: hidden; font-size: 2rem; color: var(--profile-accent); }
.member-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-profile-dialog h2 { margin-bottom: 6px; }
.member-profile-note { margin: 24px 0 0; font-size: .75rem; line-height: 1.5; color: var(--text-dim); }
.profile-page { max-width: 900px; }
.profile-page-heading { margin-bottom: 22px; }
.profile-page-heading h3 { margin: 0 0 6px; font-size: 1.5rem; }
.profile-page-heading p, .profile-hint { margin: 0; color: var(--text-dim); font-size: .88rem; line-height: 1.6; }
.profile-card-preview { --profile-accent: #22c55e; position: relative; display: block; overflow: hidden; padding: 0; margin: 0 0 24px; background: var(--surface-card); }
.profile-preview-body { display: flex; align-items: flex-start; gap: 18px; padding: 24px; }
.profile-avatar-lg { position: relative; flex: 0 0 76px; width: 76px; height: 76px; margin-top: 0; border: 3px solid var(--profile-accent); border-radius: 18px; background: var(--surface); color: var(--profile-accent); box-shadow: 0 0 0 5px var(--surface-card); }
.profile-avatar-lg[data-shape="circle"] { border-radius: 50%; }
.profile-avatar-lg[data-shape="square"] { border-radius: 5px; }
.profile-avatar-lg[data-shape="rounded"] { border-radius: 18px; }
.profile-preview-details { min-width: 0; flex: 1; padding-top: 15px; }
.profile-name-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; }
.profile-name-line h4 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.profile-pronouns { color: var(--text-dim); font-size: .78rem; }
.profile-preview-status { margin: 5px 0 0; color: var(--profile-accent); font-size: .83rem; overflow-wrap: anywhere; }
.profile-preview-bio { margin: 9px 0 0; color: var(--text-dim); font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile-field-label { font-size: .85rem; font-weight: 700; }
.profile-field-help { margin-top: 4px; font-size: .8rem; color: var(--text-dim); }
.profile-form .settings-row { align-items: center; }
.profile-form .settings-row > :first-child { flex: 1 1 180px; }
.profile-form .settings-input { width: min(100%, 300px); }
.profile-form textarea.settings-input { resize: vertical; min-height: 80px; }
.profile-avatar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.profile-avatar-controls .settings-input { width: 190px; }
.profile-username-controls { display: flex; align-items: center; gap: 9px; width: min(100%, 390px); }
.profile-username-prefix { flex: 0 0 auto; color: var(--accent); font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 1.08rem; }
.profile-username-controls .settings-input { flex: 1 1 auto; min-width: 0; width: auto; }
.profile-username-controls .action-btn { flex: 0 0 auto; white-space: nowrap; }
.profile-color-input { height: 40px; width: 54px; padding: 3px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.profile-save-status { min-height: 1.2em; margin: 12px 0 0; font-size: .78rem; color: var(--text-dim); }
.profile-save-status.error { color: #fca5a5; }

/* Cinema */
#view-movies { max-width: 1400px; }
#view-movies .movie-hero { position: relative; min-height: 360px; display: flex; align-items: center; margin-bottom: 34px; padding: clamp(24px, 4vw, 52px); border-radius: 16px; background: #111b15; isolation: isolate; }
.movie-backdrop { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.movie-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; filter: blur(18px) saturate(.8); opacity: .48; transform: scale(1.08); }
.movie-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 9, 8, .96) 8%, rgba(6, 9, 8, .76) 52%, rgba(6, 9, 8, .4)), linear-gradient(0deg, rgba(6, 9, 8, .7), transparent 80%); }
.movie-hero-content { min-width: 0; flex: 1 1 auto; max-width: 650px; position: relative; z-index: 1; }
.cinema-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--accent); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .7rem; letter-spacing: .16em; }
.cinema-eyebrow::before { content: ''; height: 7px; width: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
#view-movies .movie-hero h2 { max-width: 650px; margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.05; letter-spacing: -.045em; }
.movie-feature-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; color: #cbd7cf; font-size: .8rem; }
.movie-feature-meta span { border: 1px solid rgba(255,255,255,.17); border-radius: 6px; padding: 4px 8px; background: rgba(0,0,0,.25); }
#view-movies .movie-hero p { max-width: 500px; color: #c3cec5; font-size: .93rem; }
.movie-hero-btn { gap: 9px; padding: 12px 19px; }
.movie-feature-poster { width: clamp(120px, 15vw, 190px); aspect-ratio: 2 / 3; object-fit: cover; flex: none; margin-left: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 18px 45px rgba(0,0,0,.55); }
.cinema-library-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.cinema-library-header h3 { margin: 0 0 5px; font-size: 1.3rem; }
.cinema-library-header p { margin: 0; color: var(--text-dim); font-size: .83rem; }
.cinema-search { width: min(350px, 45%); position: relative; flex: 0 1 350px; }
.cinema-search .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
#view-movies #movie-search { padding: 12px 14px 12px 42px; }
.movie-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 12px; margin-bottom: 10px; }
.movie-filter { flex: none; border: 1px solid var(--border); border-radius: 99px; padding: 8px 14px; color: var(--text-dim); background: var(--surface-card); font: inherit; font-size: .78rem; cursor: pointer; }
.movie-filter:hover { color: var(--text); border-color: var(--border-active); }
.movie-filter[aria-pressed="true"] { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .1); }
.movie-results-label { margin: 0 0 14px; color: var(--text-dim); font-size: .78rem; }
#view-movies .movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: start; gap: 18px; }
#view-movies .movie-card { width: 100%; display: block; padding: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; font: inherit; box-shadow: none; }
.movie-poster-wrap { position: relative; display: block; overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface); }
#view-movies .movie-card-thumb { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.movie-play-badge { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #031007; box-shadow: 0 5px 20px #0008; }
#view-movies .movie-card-info { min-height: 68px; padding: 12px; background: var(--surface-card); }
#view-movies .movie-card-title { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
#view-movies .movie-card-genre { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-family: inherit; }
.movie-empty { grid-column: 1 / -1; padding: 32px; color: var(--text-dim); text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.movie-recommendation-empty { grid-column: 1 / -1; margin: 0; color: var(--text-dim); font-size: .8rem; }
.movie-rec-card { width: 100%; padding: 0; color: var(--text); font: inherit; }
#theater-overlay[data-media-type="movie"] .movie-rec-card img { display: block; aspect-ratio: 2 / 3; }
@media (max-width: 900px) {
  .profile-preview-body { padding: 18px; }
  .profile-form .settings-row { align-items: flex-start; }
  .profile-avatar-controls { justify-content: flex-start; }
  #view-movies .movie-hero { min-height: 310px; }
  #view-movies .movie-hero h2 { font-size: clamp(1.9rem, 6vw, 3.1rem) !important; }
  #view-movies .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
}
@media (max-width: 600px) {
  #view-movies .movie-hero { min-height: 0; align-items: flex-start; padding: 24px 18px; }
  #view-movies .movie-hero h2 { font-size: 2rem !important; }
  .movie-feature-poster { width: 88px; margin: 5px 0 0 12px; border-radius: 8px; }
  .cinema-library-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .cinema-search { width: 100%; flex-basis: auto; }
  #view-movies .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .profile-form .settings-row > :not(:first-child) { width: 100%; }
  .profile-form .settings-input { width: 100%; }
  .profile-avatar-controls .settings-input { width: 100%; }
  .profile-username-controls { width: 100%; }
  .profile-username-controls .settings-input { width: auto; }
}
@media (max-width: 350px) { .movie-feature-poster { display: none; } }

/* Shared Flux surfaces, controls and compact device status. */
.header-action.nav-item.profile-shortcut { border-radius: 50%; }
.sidebar-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px 0; color: var(--text-dim); font-size: .73rem; font-weight: 600; }
.sidebar-status-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sidebar-status-item i { color: var(--accent); font-size: .75rem; }
.settings-wrap, .lounge-sidebar-pane, .lounge-chat-pane, .profile-card-preview { background-color: var(--surface-card); border: 1px solid var(--border); border-radius: 14px; }
.lounge-header-bar, .lounge-input-bar, .settings-row { border-color: var(--border); }
.lounge-nav-btn, .settings-input, .lounge-text-input { border-radius: 9px; }
.lounge-nav-btn.active { color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.profile-crop-dialog { padding: 0; width: min(92vw, 540px); max-height: 90vh; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-card); color: var(--text); box-shadow: 0 28px 90px #000a; }
.profile-crop-dialog::backdrop { background: rgba(0,0,0,.72); }
.profile-crop-card { padding: 24px; }
.profile-crop-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.profile-crop-header h3 { margin: 0 0 5px; }
.profile-crop-header p { margin: 0; color: var(--text-dim); font-size: .85rem; }
.profile-crop-close { border: 0; background: transparent; color: var(--text-dim); font-size: 1.7rem; line-height: 1; cursor: pointer; }
#profile-crop-canvas { display: block; width: min(100%, 300px); height: auto; margin: 0 auto 20px; border-radius: 12px; background: #08080b; }
.profile-crop-sliders { display: grid; gap: 10px; }
.profile-crop-sliders label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; color: var(--text-dim); font-size: .8rem; }
.profile-crop-sliders input { width: 100%; accent-color: var(--accent); }
.profile-crop-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.discord-empty { margin: auto; padding: 36px; text-align: center; color: var(--text-dim); line-height: 1.6; }
.theater-viewport-box:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; border: 0; border-radius: 0; background: #000; }
.theater-viewport-box:fullscreen #theater-iframe { width: 100%; height: 100%; }

/* A shared rhythm across Home, library, community and profile. */
.container { max-width: 1400px; margin-inline: auto; }
.section-title { font-size: 1.1rem; letter-spacing: -.02em; }
.settings-wrap { padding: clamp(18px,3vw,32px); }
.action-btn, .lounge-send-btn, .movie-hero-btn { min-height: 40px; border-radius: 9px; font-family: inherit; font-weight: 650; }
.settings-input, .lounge-text-input, .search-box input { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.profile-avatar-lg, .profile-avatar-lg[data-shape], .msg-user-avatar { border-radius: 50%; overflow: hidden; }
.discord-controls { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.discord-controls[hidden] { display: none; }
.discord-controls span { flex: 1 1 200px; color: var(--text-dim); font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; }
.discord-controls button { font-size: .73rem; }
.flux-signin { border-bottom: 1px solid var(--border); padding-bottom: 24px; margin-bottom: 24px; }
.flux-signin h4 { margin: 0 0 8px; }
.flux-signin p, #flux-auth-status, .page-description { color: var(--text-dim); font-size: .85rem; line-height: 1.6; }
#flux-auth-form { display: flex; flex-wrap: wrap; gap: 12px; }
#flux-auth-form label { flex: 1 1 220px; display: grid; gap: 6px; font-size: .8rem; }
#flux-auth-form input, .ai-compose textarea { padding: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font: inherit; min-width: 0; }
.flux-auth-actions { flex: 1 1 100%; display: flex; gap: 8px; flex-wrap: wrap; }
#flux-auth-status { flex-basis: 100%; margin: 0; }
.ai-wrap { max-width: 900px; }
.ai-messages { min-height: 220px; max-height: 52vh; overflow: auto; margin-block: 24px; }
.ai-message { margin: 0 0 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ai-message strong { color: var(--accent); font-size: .8rem; }
.ai-message p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.ai-compose { display: flex; gap: 10px; align-items: end; }
.ai-compose textarea { flex: 1; resize: vertical; min-height: 72px; }
#ai-status { color: var(--text-dim); font-size: .85rem; }
button:disabled { opacity: .5; cursor: wait; }

#profile-crop-canvas { border-radius: 50%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.discord-category { padding: 14px 8px 5px; color: var(--text-dim); font-size: .65rem; font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.discord-channel-list { min-height: 28px; color: var(--text-dim); font-size: .78rem; }
.discord-channel { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.discord-channel.discord-thread { padding-left: 26px; font-size: .75rem; }
.discord-forum-post { display: grid; gap: 6px; width: 100%; margin: 0 0 10px; padding: 18px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font: inherit; }
.discord-forum-post:hover { border-color: var(--accent); }
.discord-forum-post span { color: var(--text-dim); font-size: .75rem; }
.discord-post-fields { display: flex; gap: 8px; padding-inline: 24px; }
.discord-post-fields input, .discord-post-fields select { min-width: 0; flex: 1; margin-bottom: 10px; }
.discord-post-fields [hidden] { display: none; }
.lounge-sidebar-pane { overflow-y: auto; }
.lounge-sidebar-pane > *, .discord-channel-list > * { flex-shrink: 0; }
@media (max-width: 900px) { .lounge-sidebar-pane { max-height: 340px; } }
