/* Collapsible sections (Admin Tools + For You). Dark theme, phone-first.
   Green header bar, chevron, count pill, one-line summary. */

.ax-sec {
  padding: 0 !important;
  overflow: hidden;
}

.ax-sec + .ax-sec,
.panel + .ax-sec,
.ax-sec + .panel {
  margin-top: 0.7rem;
}

.ax-head {
  margin: 0;
  font-size: 1rem;
}

.ax-head__btn {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-align: left;
  background: linear-gradient(180deg, #174d22 0%, #0d1f0e 100%);
  border-bottom: 1px solid rgba(57, 255, 20, 0.45);
  color: var(--lime, #39ff14);
}

.ax-head__btn:hover {
  background: linear-gradient(180deg, #1b5e20 0%, #102814 100%);
}

.ax-head__btn:focus-visible {
  outline: 2px solid var(--lime, #39ff14);
  outline-offset: -2px;
}

.ax-chev {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  color: var(--lime, #39ff14);
  transition: transform 0.18s ease;
}

.ax-sec.is-open .ax-chev {
  transform: rotate(0deg);
}

.ax-sec:not(.is-open) .ax-chev {
  transform: rotate(-90deg);
}

.ax-head__title {
  font-family: var(--font-heading, "Onest", sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lime, #39ff14);
}

.ax-badge {
  min-width: 1.6rem;
  text-align: center;
  font: 700 0.72rem/1 "JetBrains Mono", ui-monospace, monospace;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  background: rgba(57, 255, 20, 0.12);
  color: var(--lime, #39ff14);
  border: 1px solid rgba(57, 255, 20, 0.55);
}

.ax-badge--warn {
  background: rgba(255, 193, 7, 0.15);
  color: #ffd54f;
  border-color: rgba(255, 193, 7, 0.55);
}

.ax-badge--text {
  font-weight: 600;
  color: #c8d4c8;
  background: transparent;
  border-color: rgba(154, 163, 154, 0.45);
}

.ax-new {
  font: 700 0.6rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  color: #0a0a0a;
  background: var(--lime, #39ff14);
  padding: 0.22rem 0.35rem;
  border-radius: 4px;
}

.ax-head__summary {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #b7d4b7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}

.ax-sec.is-open .ax-head {
  border-bottom: 1px solid rgba(57, 255, 20, 0.45);
}

.ax-body {
  padding: 0.85rem 1.05rem 1rem;
}

.ax-sec:not(.is-open) .ax-body {
  display: none;
}

.ax-replaced-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.ax-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0.75rem;
}

.ax-tools .btn {
  min-height: 36px;
}

/* For You games promo keeps its row layout inside the body */
.signal-catcher-promo.ax-sec {
  display: block;
}

.signal-catcher-promo.ax-sec .ax-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  position: relative;
  min-height: 8rem;
}

/* Sticky compact Search control in the header (replaces the in-feed card on scroll) */
.hdr-search {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 36px;
  min-width: 44px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(57, 255, 20, 0.16);
  color: var(--lime, #39ff14);
  border: 1.5px solid rgba(57, 255, 20, 0.75);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.22);
  font: 700 0.78rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: auto;
  margin-right: 0.4rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hdr-search__ico {
  font-size: 1.05rem;
  line-height: 1;
}

.hdr-search__txt {
  display: inline;
}

body.search-collapsed .hdr-search,
body.has-hdr-search .hdr-search {
  /* hdr-always-20261011 (Rich 12:40 AM): the header Search button stays at every scroll position */
  display: inline-flex;
}

/* scrollfix-20261010: keep the panel's space when collapsed. display:none removed ~150px above
   the viewport on every threshold crossing: scroll anchoring then pulled scrollY back under the
   threshold (collapse/expand loop), and iOS Safari jumped the content (Admin Tools scroll glitch). */
body.search-collapsed [data-search-panel],
body.search-collapsed .chrome-strip .search-panel {
  visibility: hidden !important;
}

@media (max-width: 760px) {
  .ax-head__btn {
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }

  .ax-head__summary {
    flex: 0 0 100%;
    max-width: none;
    margin-left: 1.7rem;
  }

  /* Keep the word "Search" visible — a lone icon looked like the section vanished */
  .hdr-search {
    min-height: 40px;
    padding: 0 0.75rem;
    flex: 0 0 auto;
    margin-right: 0.35rem;
  }

  .signal-catcher-promo.ax-sec .ax-body {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ax-chev {
    transition: none;
  }
}

/* Editor's note + story card preview inside Admin Tools (dark) */
.ax-note-preview .nw-ed,
.ax-story-preview {
  background: #0b120c;
  border: 2px solid #39ff14;
  border-left-width: 6px;
  border-radius: 10px;
  padding: 0.6rem 0.75rem 0.65rem;
  color: #e4e7e4;
}

.ax-note-preview .nw-ed__by,
.ax-story-preview .nw-byline {
  margin: 0 0 0.4rem;
  font: 700 0.8rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  color: #39ff14;
}

.ax-note-preview .nw-ed__body,
.ax-story-preview .nw-card__summary {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #e4e7e4;
}

.ax-note-preview .nw-ed__upd,
.ax-story-preview .nw-card__foot {
  margin: 0.4rem 0 0;
  font: 0.72rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  color: #a3aea6;
}

.ax-story-preview {
  border-left-width: 2px;
}

.ax-story-preview h3 {
  margin: 0.2rem 0 0.45rem;
  color: #fff;
  font-size: 1.05rem;
}

.ax-story-preview a {
  color: #7ee07a;
}

.ax-form-grid {
  display: grid;
  gap: 0.55rem;
}

.ax-form-grid textarea,
.ax-form-grid input,
.ax-form-grid select {
  width: 100%;
  max-width: 40rem;
  background: var(--input-bg, #141414);
  border: 1px solid var(--input-border, #2a2a2a);
  color: #e8e8ee;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.ax-count {
  font: 0.75rem/1 "JetBrains Mono", ui-monospace, monospace;
  color: #9aa39a;
}

.settings-title {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
}

.push-optin-mount {
  margin: 0 0 0.75rem;
}

.push-optin-help {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #d7d7de;
}

.push-optin-mount:empty {
  display: none;
}

.push-pref {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  cursor: pointer;
}

.push-pref input {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: #39ff14;
  flex: 0 0 auto;
}

.push-pref strong {
  display: block;
}

.push-pref .hint {
  display: block;
}

.settings-account-actions {
  margin: 0.35rem 0 0.85rem;
}

[data-settings-account] .panel {
  margin-top: 0.7rem;
}

/* Search on For You: keep form spacing inside the collapsible body */
.search-panel.ax-sec .ax-body {
  padding-top: 0.75rem;
}

/* Admin Tools jump index. Phone-first wrap of pills. Stays visible at 390. */
.ax-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ax-jump__a {
  appearance: none;
  font: 600 0.78rem/1.2 "Onest", sans-serif;
  color: #c8f5c8;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.4);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  min-height: 36px;
  max-width: 100%;
  cursor: pointer;
  text-align: left;
}

.ax-jump__a:hover,
.ax-jump__a:focus-visible {
  border-color: var(--lime, #39ff14);
  color: var(--lime, #39ff14);
  outline: none;
}

.ax-jump__n {
  color: var(--lime, #39ff14);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  margin-left: 0.2rem;
}

.ax-jump__n--warn {
  color: #ffd54f;
}

.ax-jump__a--top {
  background: transparent;
}

.ax-backtop {
  position: fixed;
  right: 0.75rem;
  bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + 0.65rem);
  z-index: 40;
  font: 700 0.74rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  color: #0a0a0a;
  background: var(--lime, #39ff14);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  min-height: 36px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.35);
}

.ax-backtop:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (min-width: 900px) {
  body:not(.has-bottom-nav) .ax-backtop {
    bottom: 1rem;
  }
}

.ax-backtop[hidden] {
  display: none !important;
}

/* Scrolling, or resting on a link/button: invisible and not clickable,
   but still in the tab order so keyboard users can reach Back to top. */
.ax-backtop.is-quiet {
  opacity: 0;
  pointer-events: none;
}

.ax-backtop.is-quiet:focus,
.ax-backtop.is-quiet:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .ax-backtop {
    transition: none;
    animation: none;
  }
}

/* Light theme redefines --lime as a dark text green. Keep the pill neon on near-black type. */
html[data-theme="light"]:not([data-games-dark]) .ax-backtop {
  background: #39ff14;
  color: #041004;
  box-shadow: 0 2px 10px rgba(4, 16, 4, 0.28);
}

html[data-theme="light"]:not([data-games-dark]) .ax-backtop:focus-visible {
  outline-color: #041004;
}

/* Last post's actions can scroll above the floating button. */
body[data-home-page] [data-feed-list] {
  padding-bottom: 4.5rem;
}

/* hdr-fit-20261010: on phones the sticky Search chip + logo + hamburger were ~18px wider than 390px,
   pushing the hamburger off-screen (horizontal overflow). Let the logo shrink instead. */
@media (max-width: 768px) {
  .site-header .nav-inner { gap: 0.5rem; min-width: 0; }
  .site-header .site-logo { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; overflow: hidden; }
  .site-header .site-logo img { min-width: 0; max-width: 100%; height: auto; }
  .site-header .nav-toggle, .site-header .hdr-search { flex: 0 0 auto; }
  .hdr-search { margin-left: auto; }
}
@media (max-width: 480px) {
  /* applogo-20261011 (Rich 7:58 AM): keep "·app" on every page; the wordmark image shrinks instead. */
  .site-header .site-logo > span { flex: 0 0 auto; }
}

/* sumcollapse-20261011 (Rich 7:31 AM via Greg): the gray one-line summary is for folded cards only.
   On an open card it just repeated the content, so hide it whenever the card is open. */
.ax-sec.is-open .ax-head__summary {
  display: none;
}

/* Site notice Show/Hide switch (Admin Tools). Hides the For You card without clearing its text. */
.admin-banner-visible {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.admin-banner-visible input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #3a3f3a;
  border: 1px solid rgba(154, 163, 154, 0.6);
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s ease;
}
.admin-banner-visible input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e4e7e4;
  transition: transform 0.15s ease;
}
.admin-banner-visible input:checked {
  background: #1b7a2a;
  border-color: var(--lime, #39ff14);
}
.admin-banner-visible input:checked::after {
  transform: translateX(20px);
}
.admin-banner-visible input:focus-visible {
  outline: 2px solid var(--lime, #39ff14);
  outline-offset: 2px;
}
.admin-banner-visible input:disabled {
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  .admin-banner-visible input,
  .admin-banner-visible input::after { transition: none; }
}

.feed-shell.ax-sec .ax-body .feed-heading { justify-content: flex-end; }

/* foryou-cards v2 (Rich 7:47 AM): Create Post + Latest Signals are fixed cards: same header, no chevron, no folding. */
.ax-head__btn--fixed { cursor: default; }
.ax-head__btn--fixed:hover { background: linear-gradient(180deg, #174d22 0%, #0d1f0e 100%); }
.ax-sec--fixed .ax-head { border-bottom: 1px solid rgba(57, 255, 20, 0.45); }

.foryou-jump[hidden] { display: none !important; }

/* gamesfold-20261011 (Rich 8:18 AM): the Games promo body is display:flex, which beat the fold rule. */
.signal-catcher-promo.ax-sec:not(.is-open) .ax-body { display: none; }
.signal-catcher-promo.ax-sec:not(.is-open) { min-height: 0; }

/* me-cards-20261011: Settings (me.html?edit=1) hides Posts and Saved; they live on Me. */
body.me-settings-mode [data-profile-timeline],
body.me-settings-mode [data-saved-panel] { display: none !important; }

/* Admin Tools pager. "Page X of N · N items" sits with the buttons on a wide screen. */
.ax-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(46, 125, 50, 0.35);
  font-size: 0.78rem;
}
.ax-pager__label {
  color: #9aa39a;
  margin-right: 0.2rem;
}
.ax-pg {
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(57, 255, 20, 0.25);
  background: transparent;
  color: #c8f5c8;
  font: 600 0.78rem/1 "JetBrains Mono", ui-monospace, monospace;
  cursor: pointer;
}
.ax-pg:hover:not(:disabled) {
  border-color: var(--lime, #39ff14);
  color: var(--lime, #39ff14);
}
.ax-pg.is-current,
.ax-pg.is-current:hover,
.ax-pg.is-current:focus {
  background: var(--lime, #39ff14);
  color: #0a0a0a;
  border-color: var(--lime, #39ff14);
}
.ax-pg:disabled { opacity: 0.35; cursor: default; }
.ax-pg.is-current:disabled { opacity: 1; }
.ax-pg--gap {
  border: 0;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa39a;
  min-width: 1rem;
}
.ax-pager__info {
  margin-left: auto;
  color: #8a8a92;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
}
.admin-reports-filter { display: flex; gap: 0.35rem; margin: 0.35rem 0 0.5rem; }

@media (max-width: 760px) {
  /* Compact one-row buttons. The Page X of N label wraps onto its own line. */
  .ax-pg--hide-sm,
  .ax-pager__label,
  .ax-pg__w { display: none; }
  .ax-pager__info { flex-basis: 100%; margin-left: 0; }
}

/* News review subsections. Same green toggle as the section bars, nested inside the panel. */
.news-fold {
  margin-top: 0.75rem;
  border: 1px solid rgba(57, 255, 20, 0.28);
  border-radius: 8px;
  overflow: hidden;
}
.news-fold[hidden] { display: none !important; }
.news-fold__head {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}
.news-fold__btn.ax-head__btn {
  min-height: 44px;
  height: auto;
  border-bottom: 0;
  border-radius: 0;
}
.news-fold.is-open .news-fold__btn.ax-head__btn {
  border-bottom: 1px solid rgba(57, 255, 20, 0.45);
}
.news-fold__title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-heading, "Onest", sans-serif);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: normal;
}
.news-fold__chev {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  color: currentColor;
  transition: transform 0.18s ease;
}
.news-fold.is-open .news-fold__chev { transform: rotate(0deg); }
.news-fold:not(.is-open) .news-fold__chev { transform: rotate(-90deg); }
.news-fold__body { padding: 0.65rem 0.75rem 0.85rem; }
.news-fold__body[hidden] { display: none !important; }
.news-fold__btn .online-count {
  color: #eaffea;
  border-color: rgba(234, 255, 234, 0.75);
  background: rgba(0, 0, 0, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .news-fold__chev { transition: none; }
}
