@media (max-width: 600px) {
  header[role="banner"], .topbar, .header, .header-modern {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: inherit !important;
    box-shadow: none !important;
  }
}
.nowplaying-marquee-wrap {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nowplaying-marquee {
  display: inline-block;
  white-space: nowrap;
  min-width: 100%;
  will-change: transform;
  animation: marquee-scroll 36s linear infinite;
}
@media (max-width: 600px) {
  html, body {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .mobile-slide-wrapper {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .nowplaying-marquee {
    animation-duration: 18s !important;
  }
}
@keyframes marquee-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.queue-info {
  width: 100%;
  display: block;
  margin-top: 2px;
}
@media (max-width: 600px) {
  .ascii-banner {
    margin-bottom: 0 !important;
  }
}
@media (max-width: 600px) {
  body {
    padding-top: 30px !important;
  }
}
@media (min-width: 601px) {
  body {
    padding-top: 20px !important;
  }
}
/* Responsive topbar/toolbar layout: stacked on mobile, horizontal on desktop */
@media (min-width: 601px) {
  .topbar .toolbar {
    flex-direction: row !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }
  .topbar .toolbar > * {
    margin: 0 6px 0 0;
    text-align: left;
  }
  .topbar .toolbar input.field {
    margin: 0;
    width: 240px;
    max-width: 320px;
  }
}
/* DEBUG: Always show social fields and make them visible */
input[name*="facebook"], input[name*="instagram"], input[name*="twitter"], input[placeholder*="Facebook"], input[placeholder*="Instagram"], input[placeholder*="Twitter"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1000 !important;
  min-height: 2em;
  min-width: 60%;
}
/* =========================================
   layout.css
   - Containers, grid, header, responsive
   ========================================= */

/* Structural containers */
.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-3);
  box-sizing: border-box;
}
.container, .main, .feed, .profile, .compose, .data, .tags, .settings, .header, .search, .posts, .about, .player, .queue, .footer {
  width: 100%;
  margin: 0;
  padding-left: 5px;
  padding-right: 5px;
  box-sizing: border-box;
}

/* Grid */
.grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-3); }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

/* Header show/hide + centering */
header[role="banner"] { display: none !important; }
body.show-header header[role="banner"] {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Modern header visuals */
.head {
  display: block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.header-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-3);
  margin-top: var(--space-3);
}
@media (max-width: 600px) {
  .header-modern {
    margin-bottom: 0 !important;
  }
}
.header-bar {
  width: 100%;
  max-width: 900px;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--line2), var(--line));
  margin: 0.5em 0;
}
.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  width: 100%;
}
.logo {
  font-size: 2.1em;
  font-weight: bold;
  color: var(--fg);
  letter-spacing: 0.04em;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace !important;
}
.subtitle {
  color: var(--muted);
  font-size: 1em;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace !important;
  text-align: center;
  margin-top: 0.2em;
}
.dot { color: var(--line2); margin: 0 0.4em; }

@media (min-width: 601px) {
  .header-modern {
    margin-top: 120px !important;
    margin-bottom: var(--space-3);
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  .logo {
    font-size: clamp(1.1em, 7vw, 1.5em);
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 98vw;
    text-align: center;
      font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace !important;
  }
  .subtitle {
    font-size: 1em;
    word-break: break-word;
    white-space: normal;
    max-width: 98vw;
    text-align: center;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace !important;
  }
  .search {
    width: 100vw;
    max-width: 100vw;
    margin-left: -2vw;
    margin-right: -2vw;
    padding: 0 2vw 8px 2vw;
  }
  .search input {
    font-size: 1.1em;
    padding: 12px 10px;
    border-radius: 8px;
  }
  .feed {
    padding-bottom: 16vw;
  }
  .posts {
    gap: 18px;
  }
  .post {
    margin-bottom: 18px;
    border-radius: 10px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,0.13);
  }
  .tags, .tag-cloud {
    margin-bottom: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tag-cloud {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.7em;
    padding: 0.5em 0.2em;
    white-space: nowrap;
    min-width: 0;
  }
  .tag-cloud .tag {
    font-size: 0.9em;
    padding: 0.22em 0.7em;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  }
  .tag-cloud .tag.tag-selected,
  .tag-cloud .tag.tag-selected:active,
  .tag-cloud .tag.tag-selected:focus,
  .tag-cloud .tag.tag-selected:visited {
    background: var(--acc, #8ab4ff) !important;
    color: #111 !important;
    box-shadow: 0 1px 6px 0 rgba(138,180,255,0.13) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    outline: 0px solid var(--acc, #8ab4ff) !important;
    outline-offset: 0px !important;
    z-index: 2;
  }
  .tag-cloud::-webkit-scrollbar {
    display: none;
  }
}
@media (max-width: 400px) {
  .logo {
    font-size: clamp(0.9em, 8vw, 1.1em);
    padding: 0 2vw;
  }
  .subtitle {
    font-size: 0.9em;
    padding: 0 2vw;
  }
}
.logo { color: var(--fg); }

/* Responsive ASCII header banners */
/* Responsive ASCII banner: always monospace, scrollable, fits all screens */
.ascii-banner {
  font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace !important;
  white-space: pre;
  line-height: 1.1;
  letter-spacing: normal;
  padding: 0;
  margin: 0 auto 8px auto;
  background: none;
  border: none;
  display: block;
  font-size: min(1.1em, 3vw);
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  overflow-x: hidden;
  overflow-y: hidden;
  overflow: hidden;
  max-width: 100vw;
  touch-action: none;
  scrollbar-width: none; /* Firefox  */
  -ms-overflow-style: none; /* IE 10+ */
}
.ascii-banner::-webkit-scrollbar { display: none; }

/* Top Dock/Notice */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Very high z-index to ensure the docked player stays above embeds, iframes, and overlays */
  z-index: 30000 !important;
  background: linear-gradient(0deg, rgba(11,13,16,0.98) 80%, rgba(11,13,16,0.95) 100%), var(--bg);
  border-top: 1px solid var(--line);
  padding: 10px 12px 8px 12px;
  margin: 0;
  box-shadow: 0 -2px 12px #0004;
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .dock {
    bottom: 56px !important;
    padding-bottom: 8px !important;
  }
}

.dock .hstack {
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.topbar {
  display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px;
}
.notice { padding: 6px 8px; border: 1px dashed var(--line); border-radius: 4px; background: #0f1217; }
.warn { color: var(--warn); }

/* Responsive padding adjustments */
@media (max-width: 900px) {
  .wrap {
    max-width: 100%;
    padding: var(--space-2);
  }
}
@media (max-width: 600px) {
  /* Only remove overflow/height from main layout containers, not feed content itself */
  .container, .main, .profile, .compose, .data, .tags, .settings, .header, .search, .posts, .about, .player, .queue, .footer {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .wrap {
    max-width: 100%;
    padding: var(--space-2);
  }
  .container, .main, .feed, .profile, .compose, .data, .tags, .settings, .header, .search, .posts, .about, .player, .queue, .footer {
    padding-left: 2px;
    padding-right: 2px;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .topbar input.field,
  .toolbar input.field {
    margin-left: auto;
    margin-right: auto;
    display: block;
    text-align: center;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .box, .post {
    padding: var(--space-2);
    margin-bottom: 12px;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .feed {
    overflow: visible !important;
    -webkit-overflow-scrolling: auto !important;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    height: auto !important;
    max-height: none !important;
  }
  .topbar {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    position: static !important;
    top: auto !important;
    z-index: auto !important;
  }
  header[role="banner"] {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
  }
  input.field, .field, button, .btn {
    font-size: 1em;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .sort-icons {
    gap: 4px;
    margin-left: 0;
    justify-content: flex-start;
  }
  .profile-avatar-small {
    width: 48px;
    height: 48px;
  }
  .about-preview {
    font-size: 0.98em;
    word-break: break-word;
  }
}