/* Alongside+ Studio: Sleek 1-Line Higgsfield-Style Unified Prompt Composer
 * Self-hosted SIL OFL 1.1 fonts only (Cormorant + Figtree).
 * Zero external CDNs, zero em dashes, Daylight Ivory & Executive Navy theme parity.
 */

/* =====================================================================
   0. TOPBAR OVERLAP FIX (Clean breathing room at 1280px - 1600px)
   ===================================================================== */
.topbar-left {
  flex-shrink: 0;
}
.topbar-center {
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  gap: 6px;
  padding: 0 4px;
}
.topbar-center::-webkit-scrollbar {
  display: none;
}
.topbar-step-pill {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  gap: 5px;
  flex-shrink: 0;
}
.topbar-right {
  gap: 10px;
}
.topup-pill {
  height: 36px;
  padding: 0 15px;
  font-size: 13.5px;
}
@media (max-width: 1520px) {
  .topbar {
    padding: 0 14px;
    gap: 10px;
  }
  .brand-wordmark {
    font-size: 21px;
    gap: 5px;
  }
  .topbar-step-pill {
    padding: 0 8.5px;
    font-size: 11.5px;
    height: 29px;
    gap: 4px;
  }
  .theme-chip {
    padding: 5px 9px;
    font-size: 11.5px;
  }
  .balance-value {
    font-size: 16.5px;
  }
  .topup-pill {
    padding: 0 12px;
    font-size: 12px;
    height: 34px;
  }
}

/* =====================================================================
   1. FULL-WIDTH 2-BAR SLIM TOP CHROME + CREATION CANVAS ABOVE DOCK
   ===================================================================== */
/* overflow-x: clip preserves 0px horizontal overflow WITHOUT breaking position: sticky! */
html, body {
  overflow-x: clip !important;
}

/* Collapse redundant inner left sidebar on desktop (Bar 2 handles all 7 tools + Home/Creations/508 Social/Help) */
@media (min-width: 861px) {
  .sidebar {
    display: none !important;
  }
}

main.workspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-h));
  padding: 12px 24px 18px 24px;
}

.luminous-nav-wrap {
  max-width: none !important;
  width: 100% !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(226, 174, 86, 0.32);
}

/* Bar 1: Full-width slim executive strip */
.luminous-nav-wrap .studio-exec-bar {
  min-height: 46px;
  padding: 6px 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(226, 174, 86, 0.22) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

/* Bar 2: Full-width slim 7-Tool Switcher + Quiet Right Links (EXACT same slim height as Bar 1!) */
.hf-top-nav-bar {
  min-height: 46px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(5, 18, 34, 0.44);
}
.hf-top-nav-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-left: 10px;
  border-left: 1px solid rgba(242, 207, 126, 0.2);
}
.hf-quiet-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(232, 238, 248, 0.78);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.14s ease, background 0.14s ease;
}
.hf-quiet-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}
.hf-quiet-link.active {
  color: #FCE6A6;
  background: rgba(226, 174, 86, 0.16);
}
.hf-quiet-link.is-social {
  color: #F6DA8B;
}
@media (max-width: 960px) {
  .hf-top-nav-right {
    display: none;
  }
}
.hf-top-nav-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.hf-top-nav-track::-webkit-scrollbar {
  display: none;
}
.hf-top-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(242, 207, 126, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #E8EEF8;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.hf-top-nav-pill:hover {
  background: rgba(226, 174, 86, 0.18);
  border-color: rgba(242, 207, 126, 0.55);
  color: #FFFFFF;
}
.hf-top-nav-pill.active {
  background: linear-gradient(135deg, #F2CF7E 0%, #DA9F42 100%);
  border-color: #FCE6A6;
  color: #071B30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.hf-top-nav-pill.is-external {
  border-color: rgba(242, 207, 126, 0.42);
  color: #F6DA8B;
}
.hf-top-nav-bar .hf-scroll-arrow {
  background: #0D2542;
  color: #FCE6A6;
  border-color: rgba(242, 207, 126, 0.55);
}
.hf-top-nav-bar .hf-scroll-arrow.is-left::before {
  background: linear-gradient(90deg, #071A30 55%, transparent 100%);
}
.hf-top-nav-bar .hf-scroll-arrow.is-right::before {
  background: linear-gradient(270deg, #071A30 55%, transparent 100%);
}

/* Razor-slim 1-line Sign-In Strip (never eats half the canvas when logged out) */
.auth-banner:not(.hidden) {
  max-width: none !important;
  width: 100% !important;
  padding: 7px 14px !important;
  margin: 0 0 12px 0 !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 12px !important;
}
.auth-banner .auth-banner-main {
  flex: 1 1 auto !important;
  min-width: 0;
  gap: 2px !important;
}
.auth-banner .auth-banner-unlock-steps {
  display: none !important;
}
.auth-banner .auth-banner-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
}
.auth-banner .auth-banner-text strong {
  font-size: 13px;
}
.auth-banner .auth-banner-text span {
  font-size: 12px;
}
.auth-banner .auth-banner-actions .btn {
  padding: 5px 11px;
  font-size: 12px;
}

.recipe-explainer-bar,
.view-panel {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Full creation canvas populates cleanly ABOVE the sticky floating prompt dock */
.view-panel.active {
  flex: 1 0 auto;
  padding-bottom: 18px;
}
.workspace.hf-has-dock .view-panel.active {
  padding-bottom: 24px;
}

/* Hide legacy tall stacked form cards on creation views while preserving live DOM bindings */
.workspace.hf-tool-active .view-panel.active .tool-topbar,
.workspace.hf-tool-active .view-panel.active .panel-header,
.workspace.hf-tool-active .view-panel.active .blender-exclusive-banner,
.workspace.hf-tool-active .view-panel.active #dubBenchmarkStrip,
.workspace.hf-tool-active .view-panel.active .studio-grid > .card:first-child {
  display: none !important;
}

/* Clean full-width Output Stage + 2-Row Lush Higgsfield Visual Feed directly ABOVE the sticky bottom dock */
.workspace.hf-tool-active .view-panel.active .studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
/* Hide empty placeholder box so the 2-row lush visual feed fills the canvas immediately;
   automatically reveals the moment a generation starts or finishes! */
.workspace.hf-tool-active .view-panel.active .result-stage.hf-stage-empty {
  display: none !important;
}
.workspace.hf-tool-active .view-panel.active .result-stage {
  min-height: 156px;
  padding: 16px 20px;
}

/* True Responsive Masonry / Mosaic Visual Gallery Feed Above Sticky Dock
 * Native aspect ratios (9:16 portrait reels, 2:3 & 3:4 art, 1:1 squares, 16:9 widescreen videos)
 * nestle tightly with zero awkward blank row gaps and zero cropped heads.
 */
.hf-featured-feed {
  margin: 0 0 18px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.hf-featured-feed.hidden {
  display: none !important;
}
.hf-feed-grid {
  display: block;
  column-count: 4;
  column-gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.hf-feed-tile {
  position: relative;
  display: inline-block;
  width: 100%;
  vertical-align: top;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 14px 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: auto;
  background: #081C32;
  border: 1px solid rgba(212, 168, 75, 0.34);
  box-shadow: 0 8px 22px rgba(6, 26, 46, 0.14);
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hf-feed-tile:hover {
  transform: translateY(-2px);
  border-color: #E8B85B;
  box-shadow: 0 14px 30px rgba(6, 26, 46, 0.24);
}
.hf-feed-tile img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.hf-feed-tile.is-portrait-fit img {
  object-position: center top;
}
.hf-feed-tile:hover img {
  transform: scale(1.03);
}
.hf-feed-top-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(6, 22, 40, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(242, 207, 126, 0.48);
  color: #FCE6A6;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  pointer-events: none;
  max-width: calc(100% - 50px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hf-feed-play-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid #FCE6A6;
  background: rgba(8, 30, 53, 0.84);
  color: #FCE6A6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
  transition: transform 0.16s ease, background 0.16s ease;
}
.hf-feed-play-pill:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: linear-gradient(135deg, #F4D480 0%, #D9A13B 100%);
  color: #081E35;
}
.hf-feed-play-pill svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
  fill: currentColor;
}
.hf-feed-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 28px 10px 10px;
  background: linear-gradient(180deg, rgba(6, 20, 38, 0) 0%, rgba(6, 20, 38, 0.80) 40%, rgba(5, 16, 30, 0.96) 100%);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Video & 3D mosaic tiles dock their title & action bar cleanly below the frame so 16:9 posters & play controls stay 100% unobstructed */
.hf-feed-tile[data-hf-media-type="video"] .hf-feed-overlay,
.hf-feed-tile[data-hf-media-type="3d"] .hf-feed-overlay {
  position: static;
  padding: 10px 11px 11px;
  background: linear-gradient(180deg, #0A203A 0%, #061629 100%);
  border-top: 1px solid rgba(242, 207, 126, 0.22);
}
.hf-feed-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.24;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.hf-feed-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.hf-feed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 32, 58, 0.88);
  color: #F8F4EA;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.hf-feed-btn:hover {
  background: #F2CF7E;
  border-color: #FCE6A6;
  color: #081E35;
}
.hf-feed-btn.is-gold {
  background: linear-gradient(135deg, #F4D480 0%, #DA9F42 100%);
  border-color: #FCE6A6;
  color: #081E35;
}
/* Tablet: 3-column responsive mosaic */
@media (max-width: 1199px) {
  .hf-feed-grid:not(.is-audio-grid) {
    column-count: 3;
    column-gap: 12px;
  }
  .hf-feed-grid:not(.is-audio-grid) .hf-feed-tile {
    margin-bottom: 12px;
  }
}
/* Mobile: 2-column responsive mosaic with 0px horizontal overflow & clean non-overlapping card footers */
@media (max-width: 767px) {
  .hf-feed-grid:not(.is-audio-grid) {
    column-count: 2;
    column-gap: 10px;
  }
  .hf-feed-grid:not(.is-audio-grid) .hf-feed-tile {
    margin-bottom: 10px;
    border-radius: 12px;
  }
  .hf-feed-tile .hf-feed-overlay {
    position: static;
    padding: 8px 8px 9px;
    background: linear-gradient(180deg, #0A203A 0%, #061629 100%);
    border-top: 1px solid rgba(242, 207, 126, 0.20);
    gap: 5px;
  }
  .hf-feed-top-badge {
    top: 6px;
    left: 6px;
    padding: 2px 7px;
    font-size: 9px;
    max-width: calc(100% - 40px);
  }
  .hf-feed-play-pill {
    width: 36px;
    height: 36px;
  }
  .hf-feed-play-pill svg {
    width: 14px;
    height: 14px;
  }
  .hf-feed-title {
    font-size: 11px;
  }
  .hf-feed-actions {
    gap: 4px;
  }
  .hf-feed-btn {
    height: 22px;
    padding: 0 6.5px;
    font-size: 9.5px;
  }
}
.workspace.hf-tool-active .view-panel.active .empty-stage {
  min-height: 122px;
  padding: 12px;
}
.workspace.hf-tool-active .view-panel.active .empty-stage h3 {
  font-size: 22px;
  margin: 6px 0 4px;
}
.workspace.hf-tool-active .view-panel.active .empty-stage p {
  margin: 0;
  font-size: 13.5px;
  max-width: 640px;
}
.workspace.hf-tool-active .view-panel.active .sr-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}
@media (max-width: 1120px) {
  .workspace.hf-tool-active .view-panel.active .sr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 600px) {
  .workspace.hf-tool-active .view-panel.active .sr-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* =====================================================================
   2. STICKY FLOATING BOTTOM HIGGSFIELD PROMPT DOCK (GENERATIONS ABOVE!)
   ===================================================================== */
.hf-composer-shell {
  position: sticky;
  bottom: 14px;
  z-index: 45;
  max-width: 1080px;
  width: calc(100% - 24px);
  margin: 18px auto 0 auto;
}
.hf-composer-shell.hidden {
  display: none !important;
}

.hf-composer-card {
  background: rgba(255, 253, 248, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(6, 26, 46, 0.24), 0 4px 14px rgba(185, 135, 50, 0.22);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.hf-composer-card:focus-within {
  border-color: var(--border-gold-strong);
  box-shadow: 0 18px 48px rgba(6, 26, 46, 0.28), 0 0 0 3px rgba(212, 168, 75, 0.24);
}

html[data-theme="navy"] .hf-composer-card {
  background: rgba(11, 24, 45, 0.96);
  border-color: rgba(232, 184, 91, 0.56);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(232, 184, 91, 0.22);
}

/* Row 1: Top Slim Mode Pills & Quick Prompt Utilities */
.hf-mode-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-soft);
}
html[data-theme="navy"] .hf-mode-strip {
  background: rgba(5, 18, 34, 0.56);
}

.hf-mode-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hf-mode-pills::-webkit-scrollbar {
  display: none;
}

.hf-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}
.hf-mode-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.84;
}
.hf-mode-btn:hover {
  background: rgba(204, 164, 78, 0.14);
  color: var(--text-primary);
}
.hf-mode-btn.active {
  background: linear-gradient(135deg, #081E35 0%, #143359 100%);
  border-color: rgba(232, 184, 91, 0.65);
  color: #FCE6A6;
  box-shadow: 0 3px 10px rgba(6, 26, 46, 0.2);
}
.hf-mode-btn.active svg {
  opacity: 1;
  color: #F2CF7E;
}
html[data-theme="navy"] .hf-mode-btn.active {
  background: linear-gradient(135deg, #F2CF7E 0%, #DA9F42 100%);
  border-color: #FCE6A6;
  color: #071B30;
}
html[data-theme="navy"] .hf-mode-btn.active svg {
  color: #071B30;
}

.hf-mode-utils {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hf-util-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.hf-util-btn:hover {
  border-color: var(--border-gold);
  background: var(--bg-subtle);
}
.hf-util-btn.is-enhance {
  background: linear-gradient(135deg, #0A223E 0%, #173861 100%);
  border-color: rgba(232, 184, 91, 0.55);
  color: #FCE6A6;
}
.hf-util-btn.is-enhance:hover {
  filter: brightness(1.1);
}
.hf-util-btn.listening {
  background: #DC2626;
  border-color: #FCA5A5;
  color: #FFFFFF;
}
.hf-edu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid #D4AF37;
  background: #0B1F3A;
  color: #F6DA8B;
  font: 800 12px/1 var(--font-sans);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.14s ease, background 0.14s ease;
}
.hf-edu-trigger:hover {
  background: linear-gradient(135deg, #F6DA8B 0%, #D4AF37 100%);
  color: #0B1F3A;
  transform: scale(1.06);
}

/* Row 2: Generous Distraction-Free Prompt Area + Inline Attachment Chips */
.hf-prompt-zone {
  padding: 9px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.hf-attach-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hf-attach-chips.hidden {
  display: none !important;
}

.hf-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  max-width: 280px;
}
.hf-attach-thumb {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  background: #0B1F3A;
  flex-shrink: 0;
}
.hf-attach-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0B1F3A 0%, #193C6A 100%);
  color: #F6DA8B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.hf-attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.hf-attach-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}
.hf-attach-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.hf-attach-clear {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: rgba(10, 33, 60, 0.1);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html[data-theme="navy"] .hf-attach-clear {
  background: rgba(255, 255, 255, 0.12);
}
.hf-attach-clear:hover {
  background: #DC2626;
  color: #FFFFFF;
}
.hf-attach-tag-btn {
  border: 1px solid var(--border-gold);
  background: rgba(226, 174, 86, 0.16);
  color: var(--gold-deep);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
html[data-theme="navy"] .hf-attach-tag-btn {
  color: #FCE6A6;
}
.hf-attach-tag-btn:hover {
  background: var(--border-gold);
  color: #081E35;
}
.hf-attach-add-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1.5px dashed var(--border-gold);
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.hf-attach-add-chip:hover {
  background: rgba(226, 174, 86, 0.16);
  border-color: var(--border-gold-strong);
}

/* =====================================================================
   3B. COMPACT (i) HOW TO: 8-PILL VISUAL GUIDE STRIP UNDER OPTIONS BAR
   ===================================================================== */
.hf-howto-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  padding: 7px 12px;
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(90deg, rgba(8, 30, 53, 0.045) 0%, rgba(212, 168, 75, 0.09) 100%);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hf-howto-bar::-webkit-scrollbar {
  display: none;
}
html[data-theme="navy"] .hf-howto-bar {
  background: linear-gradient(90deg, rgba(5, 16, 30, 0.85) 0%, rgba(20, 44, 76, 0.72) 100%);
}
.hf-howto-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-deep);
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 4px;
}
html[data-theme="navy"] .hf-howto-kicker {
  color: #F6DA8B;
}
.hf-howto-kicker-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #0B1F3A;
  border: 1.5px solid #D4AF37;
  color: #F6DA8B;
  font: 800 10.5px/1 var(--font-sans);
  text-transform: none;
}
.hf-howto-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(186, 146, 68, 0.36);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}
.hf-howto-pill:hover {
  border-color: var(--border-gold-strong);
  background: rgba(226, 174, 86, 0.22);
  transform: translateY(-1px);
}
.hf-howto-num {
  color: var(--gold-deep);
  font-weight: 800;
  font-size: 10.5px;
}
html[data-theme="navy"] .hf-howto-num {
  color: #F2CF7E;
}

/* =====================================================================
   3C. VISUAL HOW-TO MODAL (IMAGES & PLAYABLE 1.0x EXPLAINER VIDEOS)
   ===================================================================== */
.hf-howto-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482600;
  background: rgba(5, 14, 28, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hf-howto-backdrop.open {
  display: flex;
}
.hf-howto-dialog {
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid #D4AF37;
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(4, 12, 24, 0.56);
  overflow: hidden;
  animation: hfPopIn 0.16s ease-out;
}
html[data-theme="navy"] .hf-howto-dialog {
  background: #0D1E36;
}
.hf-howto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #081E35 0%, #143359 100%);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(226, 174, 86, 0.38);
}
.hf-howto-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #F6DA8B;
  margin-bottom: 3px;
}
.hf-howto-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.12;
  color: #FFFFFF;
}
.hf-howto-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hf-howto-media-video {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #07192D;
  border: 1px solid var(--border-gold);
}
.hf-howto-media-video video {
  width: 100%;
  max-height: 310px;
  display: block;
  background: #051222;
}
.hf-howto-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hf-howto-media-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hf-howto-img-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #081D34;
  display: flex;
  flex-direction: column;
}
.hf-howto-img-card img {
  width: 100%;
  height: 152px;
  object-fit: cover;
  display: block;
}
.hf-howto-img-cap {
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 700;
  color: #FCE6A6;
  background: #081E35;
}
.hf-howto-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.hf-howto-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
}
.hf-howto-bullet-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F4D480 0%, #D79E3A 100%);
  color: #081E35;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.hf-howto-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-subtle);
}
.hf-howto-foot-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .hf-howto-media-grid,
  .hf-howto-media-grid.cols-2 {
    grid-template-columns: 1fr;
  }
  .hf-howto-title {
    font-size: 21px;
  }
}

.hf-prompt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.hf-prompt-inline-utils {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 2px;
}

.hf-prompt-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 2px 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.44;
}
.hf-prompt-input::placeholder {
  color: var(--text-muted);
}

.hf-cleanup-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-gold);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.hf-cleanup-drop:hover,
.hf-cleanup-drop.dragover {
  background: rgba(226, 174, 86, 0.16);
  border-color: var(--border-gold-strong);
}
.hf-cleanup-drop-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
}
.hf-cleanup-drop-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.hf-char-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  align-self: flex-end;
  margin-top: -4px;
}

.hf-feedback-strip {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  border: 1px solid var(--border-gold);
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.hf-feedback-strip.is-error {
  background: var(--badge-err-bg);
  border-color: var(--badge-err-border);
  color: var(--badge-err-text);
}
.hf-feedback-strip.is-ok {
  background: var(--badge-ok-bg);
  border-color: var(--badge-ok-border);
  color: var(--badge-ok-text);
}

/* =====================================================================
   3. THE 1-LINE HIGGSFIELD OPTIONS BAR (DIRECTLY UNDER PROMPT FIELD!)
   ===================================================================== */
.hf-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 9px 12px 10px;
  border-top: 1px solid var(--border-soft);
  background: rgba(247, 241, 226, 0.56);
}
html[data-theme="navy"] .hf-options-bar {
  background: rgba(6, 20, 38, 0.72);
}

.hf-pills-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1px 0;
}
.hf-pills-track::-webkit-scrollbar {
  display: none;
}

/* Tactile Higgsfield-style < and > horizontal scroll arrows with soft edge fade */
.hf-scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.hf-scroll-wrap > .hf-mode-pills,
.hf-scroll-wrap > .hf-pills-track,
.hf-scroll-wrap > .hf-howto-track {
  width: 100%;
}
.hf-howto-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1px 0;
}
.hf-howto-track::-webkit-scrollbar {
  display: none;
}
.hf-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1.5px solid var(--border-gold);
  background: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 10px rgba(6, 26, 46, 0.18);
  transition: opacity 0.15s ease, transform 0.12s ease, background 0.14s ease;
}
.hf-scroll-arrow::before {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 22px;
  pointer-events: none;
  z-index: -1;
}
.hf-scroll-arrow.is-left {
  left: 0;
}
.hf-scroll-arrow.is-left::before {
  left: 0;
  width: 34px;
  background: linear-gradient(90deg, var(--bg-subtle) 55%, transparent 100%);
}
.hf-scroll-arrow.is-right {
  right: 0;
}
.hf-scroll-arrow.is-right::before {
  right: 0;
  width: 34px;
  background: linear-gradient(270deg, var(--bg-subtle) 55%, transparent 100%);
}
html[data-theme="navy"] .hf-scroll-arrow {
  background: #102540;
  color: #FCE6A6;
  border-color: rgba(242, 207, 126, 0.58);
}
html[data-theme="navy"] .hf-scroll-arrow.is-left::before {
  background: linear-gradient(90deg, #08182C 55%, transparent 100%);
}
html[data-theme="navy"] .hf-scroll-arrow.is-right::before {
  background: linear-gradient(270deg, #08182C 55%, transparent 100%);
}
.hf-scroll-arrow:hover {
  background: linear-gradient(135deg, #F4D480 0%, #D9A13B 100%);
  color: #081E35;
}
.hf-scroll-arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.hf-scroll-arrow svg {
  width: 13px;
  height: 13px;
  display: block;
}

.hf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(186, 146, 68, 0.42);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}
.hf-pill:hover {
  border-color: var(--border-gold-strong);
  background: var(--bg-subtle);
}
.hf-pill.is-open,
.hf-pill[aria-expanded="true"] {
  border-color: var(--border-gold-strong);
  background: rgba(226, 174, 86, 0.2);
  box-shadow: 0 0 0 2px rgba(212, 168, 75, 0.28);
}
.hf-pill.is-attach {
  background: linear-gradient(135deg, rgba(10, 33, 60, 0.06), rgba(212, 168, 75, 0.12));
  border-style: dashed;
  border-color: var(--border-gold);
}
.hf-pill.is-attach.has-file {
  border-style: solid;
  border-color: #16A34A;
  background: rgba(22, 163, 74, 0.1);
}
.hf-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #16A34A;
  flex-shrink: 0;
}
.hf-pill-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="navy"] .hf-pill-icon {
  color: #F2CF7E;
}
.hf-pill-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
}
.hf-pill-val {
  color: var(--text-primary);
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hf-pill-chev {
  width: 12px;
  height: 12px;
  opacity: 0.65;
  flex-shrink: 0;
  transition: transform 0.14s ease;
}
.hf-pill[aria-expanded="true"] .hf-pill-chev {
  transform: rotate(180deg);
}

/* Right-Aligned Generate Action Button on the EXACT SAME Single Horizontal Line */
.hf-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #F4D891;
  background: linear-gradient(135deg, #F4D480 0%, #DFAA49 55%, #C98D2B 100%);
  color: #081E35;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(185, 135, 50, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}
.hf-generate-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(185, 135, 50, 0.42);
}
.hf-generate-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}
.hf-gen-cost {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 30, 53, 0.14);
  color: #081E35;
}

/* =====================================================================
   4. FLOATING PORTAL POPOVER (ZERO CLIPPING ON DESKTOP & MOBILE)
   ===================================================================== */
.hf-popover-portal {
  position: fixed;
  z-index: 2147482000;
  width: min(360px, calc(100vw - 20px));
  max-height: min(70vh, 460px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border-gold);
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(4, 15, 30, 0.34), 0 4px 12px rgba(185, 135, 50, 0.2);
  overflow: hidden;
  animation: hfPopIn 0.14s ease-out;
}
.hf-popover-portal.is-wide {
  width: min(520px, calc(100vw - 20px));
}
html[data-theme="navy"] .hf-popover-portal {
  background: #0D1F38;
  border-color: rgba(232, 184, 91, 0.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
@keyframes hfPopIn {
  from { opacity: 0; transform: translateY(4px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hf-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #081E35 0%, #122F54 100%);
  color: #FCE6A6;
  border-bottom: 1px solid rgba(226, 174, 86, 0.35);
}
.hf-pop-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  color: #FCE6A6;
}
.hf-pop-sub {
  font-size: 11px;
  color: rgba(248, 244, 234, 0.78);
  font-weight: 600;
}
.hf-pop-close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(246, 218, 139, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: #FCE6A6;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hf-pop-close:hover {
  background: rgba(246, 218, 139, 0.22);
  color: #FFFFFF;
}

.hf-pop-body {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hf-pop-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.hf-pop-opt:hover {
  border-color: var(--border-gold);
  background: var(--bg-subtle);
}
.hf-pop-opt.selected {
  border-color: var(--border-gold-strong);
  background: rgba(226, 174, 86, 0.17);
  box-shadow: inset 0 0 0 1px rgba(185, 135, 50, 0.25);
}
.hf-pop-opt-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.hf-pop-opt-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hf-pop-opt-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
}
.hf-pop-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-gold);
  color: var(--gold-deep);
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="navy"] .hf-pop-badge {
  color: #F6DA8B;
}

.hf-pop-ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.hf-ratio-glyph {
  display: inline-block;
  border: 1.8px solid currentColor;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.85;
}

.hf-pop-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-deep);
  padding: 4px 2px 2px;
}
html[data-theme="navy"] .hf-pop-section-label {
  color: #F6DA8B;
}

.hf-pop-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--border-gold);
  background: var(--bg-subtle);
  cursor: pointer;
}
.hf-pop-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #D9A54A;
  flex-shrink: 0;
}

/* Compact styling for reparented live decks inside popovers */
.hf-popover-portal .ref-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.hf-popover-portal .av-ref-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.hf-popover-portal .lang-grid {
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.hf-popover-portal .eta-math-card {
  padding: 9px 11px;
  margin: 4px 0;
}

/* Hidden offscreen dock for live reparented DOM nodes when popover is closed */
.hf-reparent-dock {
  display: none !important;
}

/* =====================================================================
   5. MOBILE RESPONSIVE (390px: 0px OVERFLOW, SMOOTH 1-LINE PILL SCROLL)
   ===================================================================== */
@media (max-width: 720px) {
  main.workspace {
    padding: 8px 10px 14px 10px;
  }
  .luminous-nav-wrap .studio-exec-bar {
    min-height: 40px;
    padding: 6px 9px !important;
  }
  .hf-top-nav-bar {
    min-height: 40px;
    padding: 5px 9px;
  }
  .hf-composer-shell {
    bottom: 8px;
    width: 100%;
    max-width: 100%;
    margin: 12px auto 0 auto;
  }
  .hf-composer-card {
    border-radius: 14px;
  }
  .hf-mode-strip {
    padding: 6px 8px;
    gap: 5px;
  }
  .hf-mode-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 12px;
  }
  .hf-util-btn span.hf-util-txt {
    display: none;
  }
  .hf-util-btn {
    padding: 0 7px;
    height: 26px;
  }
  .hf-prompt-zone {
    padding: 8px 11px 5px;
  }
  .hf-prompt-input {
    min-height: 40px;
    font-size: 14.5px;
  }
  .hf-options-bar {
    padding: 7px 8px;
    gap: 6px;
  }
  .hf-pill {
    height: 31px;
    padding: 0 9px;
    font-size: 12px;
  }
  .hf-pill-label {
    display: none;
  }
  .hf-generate-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    gap: 4px;
  }
  .hf-gen-cost {
    display: none;
  }
  .hf-popover-portal .ref-slots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-banner:not(.hidden) {
    flex-direction: column;
    align-items: flex-start !important;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    gap: 6px !important;
  }
  .auth-banner .auth-banner-main {
    flex: 0 0 auto !important;
    width: 100%;
  }
  .auth-banner .auth-banner-text span {
    display: none;
  }
}

/* =====================================================================
   2B. STUDIO NOTIFICATION / UPDATES STRIP ABOVE PROMPT DOCK
   ===================================================================== */
.hf-notif-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 auto 7px auto;
  padding: 7px 11px 7px 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 250, 236, 0.98) 0%, rgba(252, 243, 217, 0.98) 100%);
  border: 1.25px solid rgba(198, 146, 52, 0.58);
  box-shadow: 0 8px 22px rgba(6, 26, 46, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #0B1B3A;
  font-family: var(--font-sans, "Figtree", system-ui, sans-serif);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.hf-notif-bar.hidden {
  display: none !important;
}
html[data-theme="navy"] .hf-notif-bar {
  background: linear-gradient(90deg, rgba(13, 30, 56, 0.96) 0%, rgba(20, 42, 74, 0.96) 100%);
  border-color: rgba(232, 184, 91, 0.54);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 240, 195, 0.12);
  color: #F4F7FC;
}
.hf-notif-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 auto;
}
.hf-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: #D99B2B;
  box-shadow: 0 0 0 3px rgba(217, 155, 43, 0.25);
  animation: hfNotifPulse 2.4s ease-in-out infinite;
}
html[data-theme="navy"] .hf-notif-dot {
  background: #F6D77D;
  box-shadow: 0 0 0 3px rgba(246, 215, 125, 0.24);
}
@keyframes hfNotifPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.72; }
}
.hf-notif-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0B1B3A;
  color: #FCE6A6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
html[data-theme="navy"] .hf-notif-badge {
  background: linear-gradient(135deg, #F2CF7E 0%, #DA9F42 100%);
  color: #071B30;
}
.hf-notif-text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #102547;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
html[data-theme="navy"] .hf-notif-text {
  color: #EEF3FB;
}
.hf-notif-text strong {
  font-weight: 800;
  color: #071833;
}
html[data-theme="navy"] .hf-notif-text strong {
  color: #FCE6A6;
}
.hf-notif-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.hf-notif-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0E2547 0%, #173866 100%);
  border: 1px solid rgba(212, 168, 75, 0.55);
  color: #FCE6A6 !important;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
html[data-theme="navy"] .hf-notif-cta {
  background: linear-gradient(135deg, #F5D582 0%, #D99B38 100%);
  border-color: #FFF0BE;
  color: #071B30 !important;
}
.hf-notif-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(217, 155, 56, 0.34);
}
.hf-notif-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.hf-notif-iconbtn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(11, 27, 58, 0.18);
  background: rgba(255, 255, 255, 0.65);
  color: #163056;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.hf-notif-iconbtn:hover {
  background: #0B1B3A;
  color: #FCE6A6;
}
html[data-theme="navy"] .hf-notif-iconbtn {
  border-color: rgba(242, 207, 126, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #E2EAF6;
}
html[data-theme="navy"] .hf-notif-iconbtn:hover {
  background: rgba(242, 207, 126, 0.24);
  color: #FFFFFF;
}
@media (max-width: 720px) {
  .hf-notif-bar {
    border-radius: 13px;
    padding: 7px 9px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .hf-notif-left {
    width: 100%;
    gap: 6px;
  }
  .hf-notif-text {
    white-space: normal;
    font-size: 11.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .hf-notif-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* =====================================================================
   6. FEED FULL-SCREEN, DELETE, AUDIO TILES & LIGHTBOX EXPORT SUITE
   ===================================================================== */
.hf-feed-media-hit {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;
  background: #07182C;
  cursor: pointer;
}
.hf-feed-media-hit img,
.hf-feed-media-hit video {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.hf-feed-tile.is-portrait-fit .hf-feed-media-hit img {
  object-fit: cover;
  object-position: center top;
}
.hf-feed-del-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(8, 19, 36, 0.74);
  color: #F4F7FC;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.hf-feed-tile:hover .hf-feed-del-icon,
.hf-feed-del-icon:focus-visible,
.hf-feed-del-icon.is-confirm {
  opacity: 1;
}
.hf-feed-del-icon:hover,
.hf-feed-del-icon.is-confirm {
  background: #B91C1C;
  border-color: #FCA5A5;
  color: #FFFFFF;
  font-size: 11px;
}
.hf-feed-grid.is-audio-grid {
  display: grid;
  column-count: auto;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: 12px;
}
.hf-feed-grid.is-audio-grid .hf-feed-tile {
  display: flex;
  margin-bottom: 0;
}
.hf-feed-audio-tile {
  aspect-ratio: auto !important;
  min-height: 168px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(155deg, #102546 0%, #09172E 100%) !important;
  border: 1.25px solid rgba(232, 184, 91, 0.44) !important;
  color: #F4F7FC;
}
html[data-theme="ivory"] .hf-feed-audio-tile {
  background: linear-gradient(155deg, #FFFDF8 0%, #F7EFDD 100%) !important;
  border-color: rgba(196, 146, 52, 0.46) !important;
  color: #0B1B3A;
}
.hf-audio-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hf-feed-top-badge.is-static {
  position: static !important;
}
.hf-feed-audio-tile .hf-feed-del-icon {
  position: static !important;
  opacity: 0.9;
}
.hf-audio-tile-title {
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
}
.hf-audio-tile-sub {
  font-size: 12px;
  opacity: 0.82;
  line-height: 1.4;
}
.hf-feed-audio-tile audio {
  width: 100%;
  height: 34px;
}

/* Lightbox Export, Phone Sync & Delete Controls */
.lb-export-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-export-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.lb-vault-btn,
.lb-alongside-btn {
  width: 100%;
  justify-content: center;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
}
.lb-vault-btn.is-saved {
  border-color: rgba(16, 185, 129, 0.65) !important;
  background: rgba(16, 185, 129, 0.14) !important;
  color: #10B981 !important;
}
.lb-vault-status {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary, #94A3B8);
}
.lb-delete-btn {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 7px 12px !important;
  border-radius: 10px !important;
  border-color: rgba(239, 68, 68, 0.42) !important;
  color: #EF4444 !important;
}
.lb-delete-btn:hover {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: #EF4444 !important;
}
.masonry-pill-btn.is-danger {
  border-color: rgba(239, 68, 68, 0.48) !important;
  color: #FCA5A5 !important;
}
.masonry-pill-btn.is-danger:hover {
  background: #B91C1C !important;
  color: #FFFFFF !important;
}

.hf-stage-empty-hidden { display: none !important; }

.lb-assoc-link-btn {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  width: 100%;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  border: 1.25px solid rgba(232, 184, 91, 0.56) !important;
  background: rgba(232, 184, 91, 0.12) !important;
  text-decoration: none !important;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.lb-assoc-link-btn:hover {
  background: rgba(232, 184, 91, 0.22) !important;
  border-color: #FCE6A6 !important;
  transform: translateY(-1px);
}
#lbAssocLinkLabel {
  font-size: 12.5px;
  font-weight: 800;
  color: #FCE6A6;
}
html[data-theme="ivory"] #lbAssocLinkLabel {
  color: #0B1B3A;
}
.lb-assoc-link-url {
  font-size: 11px;
  font-weight: 600;
  color: rgba(226, 234, 246, 0.78);
  word-break: break-all;
}
html[data-theme="ivory"] .lb-assoc-link-url {
  color: #3B5578;
}

/* =====================================================================
   7. THEME-AWARE PROMPT DOCK (IVORY LIGHT DEFAULT + NAVY DARK) & NOTIF BAR
   ===================================================================== */
.hf-notif-bar {
  background: linear-gradient(90deg, #0D2344 0%, #153462 100%) !important;
  border: 1.5px solid #D9A23D !important;
  box-shadow: 0 8px 22px rgba(7, 21, 44, 0.24) !important;
  color: #F4F7FC !important;
}
.hf-notif-badge {
  background: linear-gradient(135deg, #F5D582 0%, #D99B38 100%) !important;
  color: #071B30 !important;
}
.hf-notif-dot {
  background: #F6D77D !important;
  box-shadow: 0 0 0 3px rgba(246, 215, 125, 0.25) !important;
}
.hf-notif-text {
  color: #F1F5FC !important;
}
.hf-notif-text strong {
  color: #FCE6A6 !important;
}
.hf-notif-cta {
  background: linear-gradient(135deg, #F5D582 0%, #D99B38 100%) !important;
  border: 1px solid #FFF0BE !important;
  color: #071B30 !important;
}
.hf-notif-iconbtn {
  border-color: rgba(242, 207, 126, 0.34) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #F4F7FC !important;
}
.hf-notif-iconbtn:hover {
  background: rgba(242, 207, 126, 0.28) !important;
  color: #FFFFFF !important;
}

/* In Dark Navy mode, give the notification bar a luminous sunlit ivory-gold contrast strip */
html[data-theme="navy"] .hf-notif-bar {
  background: linear-gradient(90deg, #FFF8E3 0%, #F8E8BA 100%) !important;
  border-color: #D9A23D !important;
  color: #081A33 !important;
}
html[data-theme="navy"] .hf-notif-badge {
  background: #081A33 !important;
  color: #FCE6A6 !important;
}
html[data-theme="navy"] .hf-notif-dot {
  background: #B87409 !important;
}
html[data-theme="navy"] .hf-notif-text {
  color: #0B1F3B !important;
}
html[data-theme="navy"] .hf-notif-text strong {
  color: #051328 !important;
}
html[data-theme="navy"] .hf-notif-cta {
  background: linear-gradient(135deg, #0A1E3C 0%, #153562 100%) !important;
  border-color: #C8922E !important;
  color: #FCE6A6 !important;
}
html[data-theme="navy"] .hf-notif-iconbtn {
  border-color: rgba(8, 26, 51, 0.26) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #0A1E3C !important;
}

/* Prompt box: Light Ivory by default, Executive Navy in dark mode */
html[data-theme="navy"] .hf-composer-card {
  background: linear-gradient(180deg, #0D2242 0%, #08172E 100%) !important;
  border: 1.5px solid rgba(232, 184, 91, 0.68) !important;
  box-shadow: 0 22px 54px rgba(4, 13, 28, 0.56), 0 0 0 1px rgba(232, 184, 91, 0.22) !important;
  color: #F4F7FC !important;
}
.hf-util-btn.is-theme-tog {
  border-color: rgba(196, 146, 52, 0.45);
  font-weight: 700;
}

/* =====================================================================
   8. LIVE ANIMATED "GENERATING..." FEED TILE + STAGE MEDIA SAFETY NET
   ===================================================================== */
/* In unified composer tool views, Image/Edit/Video/Audio live inside #hfFeaturedFeed
   so raw stage cards NEVER explode behind the floating bottom prompt dock. */
.workspace.hf-tool-active #imgResultStage,
.workspace.hf-tool-active #editResultStage,
.workspace.hf-tool-active #vidResultStage,
.workspace.hf-tool-active #audioResultStage,
.workspace.hf-tool-active #imgStage,
.workspace.hf-tool-active #editStage,
.workspace.hf-tool-active #vidStage,
.workspace.hf-tool-active #audioStage {
  display: none !important;
}

/* Extra safety net: constrain any stage media frame across every viewport */
.media-frame img,
.media-frame video {
  max-height: 460px !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* Sleek high-craft animated "Generating..." placeholder tile at top-left of #hfFeaturedFeed */
.hf-feed-generating-tile {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  min-height: 230px;
  background: linear-gradient(145deg, #071A30 0%, #0E2A4D 52%, #081E38 100%) !important;
  border: 1.5px solid #E8B85B !important;
  box-shadow: 0 0 0 3px rgba(232, 184, 91, 0.24), 0 14px 32px rgba(6, 20, 38, 0.34) !important;
  color: #FFFFFF;
  scroll-margin-top: 96px;
  scroll-margin-bottom: 160px;
}
.hf-gen-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    112deg,
    rgba(242, 207, 126, 0) 20%,
    rgba(242, 207, 126, 0.14) 48%,
    rgba(255, 244, 210, 0.22) 52%,
    rgba(242, 207, 126, 0) 80%
  );
  background-size: 240% 100%;
  animation: hfGenShimmer 1.85s linear infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes hfGenShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -120% 0; }
}
.hf-feed-top-badge.is-generating {
  background: rgba(10, 30, 56, 0.92);
  border-color: #FCE6A6;
  color: #FCE6A6;
}
.hf-gen-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F6DA8B;
  box-shadow: 0 0 8px rgba(246, 218, 139, 0.9);
  animation: hfGenPulse 1.1s ease-in-out infinite;
}
@keyframes hfGenPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.45; }
}
.hf-gen-timer-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 20, 38, 0.85);
  border: 1px solid rgba(242, 207, 126, 0.45);
  color: #FCE6A6;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  z-index: 4;
}
.hf-gen-timer-pill.is-corner {
  position: absolute;
  top: 8px;
  right: 8px;
}
.hf-gen-body {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 14px 48px;
  gap: 6px;
}
.hf-gen-center-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.hf-gen-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hf-gen-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(246, 218, 139, 0.24);
  border-top-color: #F6DA8B;
  animation: spin 0.82s linear infinite;
  flex-shrink: 0;
}
.hf-gen-heading {
  font-size: 13px;
  font-weight: 800;
  color: #FCE6A6;
  letter-spacing: 0.01em;
}
.hf-gen-status {
  font-size: 11px;
  font-weight: 600;
  color: rgba(232, 238, 248, 0.82);
}
.hf-gen-overlay {
  padding: 18px 10px 9px !important;
}
.hf-gen-prompt-preview {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.32;
  color: rgba(248, 244, 234, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
.hf-feed-audio-tile.hf-feed-generating-tile {
  align-items: stretch;
  justify-content: space-between;
}
html[data-theme="ivory"] .hf-feed-audio-tile.hf-feed-generating-tile .hf-gen-heading {
  color: #FCE6A6;
}
.hf-feed-tile.is-just-finished {
  border-color: #FCE6A6 !important;
  box-shadow: 0 0 0 3px rgba(242, 207, 126, 0.45), 0 14px 32px rgba(6, 26, 46, 0.32) !important;
  animation: hfFinishGlow 1.6s ease-out;
}
@keyframes hfFinishGlow {
  0% { transform: scale(0.975); box-shadow: 0 0 0 6px rgba(242, 207, 126, 0.72); }
  100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(242, 207, 126, 0.45); }
}

/* Reinforce zero right-edge clipping inside Lightbox panel even inside dashboard iframes */
.lightbox-backdrop {
  z-index: 2147483500 !important;
}
.lightbox-shell {
  width: min(1120px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  max-height: calc(100vh - 28px) !important;
  box-sizing: border-box !important;
}
.lightbox-panel {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  padding: 18px 20px !important;
}
.lightbox-panel .lb-export-grid,
.lightbox-panel .lb-vault-btn,
.lightbox-panel .lb-alongside-btn,
.lightbox-panel .lb-delete-btn,
.lightbox-panel .lb-assoc-link-btn,
.lightbox-panel .btn-lg {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  white-space: normal !important;
}
