/* Klevby mobile home polish
   Scope: only mobile home screen.
   Desktop, posts, chat, market, ponds, map and profile are not touched.
*/

#homeSection #forecastPanel .forecast-bite-item {
  display: none;
}

#homeSection .home-weather-card {
  display: none;
}

#homeSection .home-quick-actions {
  display: none;
}

#homeSection .home-feed-preview {
  display: none;
}

@media (max-width: 767px) and (display-mode: standalone) {
  html:has(#homeSection:not(.hidden)),
  body:has(#homeSection:not(.hidden)) {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
  }

  body:has(#homeSection:not(.hidden)) #homeSection {
    min-height: var(--klevby-app-available-height);
    max-height: var(--klevby-app-available-height);
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  html.pwa-standalone:has(#homeSection:not(.hidden)),
  body.pwa-installed:has(#homeSection:not(.hidden)) {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
  }

  body.pwa-installed:has(#homeSection:not(.hidden)) #homeSection {
    min-height: var(--klevby-app-available-height);
    max-height: var(--klevby-app-available-height);
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  /*
   * Home full-viewport background — fixed layer from screen top behind header.
   * Header, #homeSection, and .mobile-tabbar stay above this layer.
   */
  body[data-app-chrome-mode="home"]:has(#homeSection:not(.hidden))::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
    transform: none;
    background:
      linear-gradient(
        180deg,
        rgba(6, 14, 22, 0.10) 0%,
        rgba(6, 16, 24, 0.24) 30%,
        rgba(6, 17, 26, 0.74) 58%,
        rgba(6, 17, 26, 0.96) 100%
      ),
      linear-gradient(
        180deg,
        rgba(8, 20, 32, 0.00) 0%,
        rgba(6, 14, 22, 0.18) 42%,
        rgba(6, 11, 18, 0.62) 100%
      ),
      url("../../img/klevgo-home-hero-bg.png") center top / cover no-repeat;
  }

  /*
   * Home bottom readability scrim — visual only, behind TouchBar.
   * Header, #homeSection, and .mobile-tabbar stay above this layer.
   */
  body[data-app-chrome-mode="home"]:has(#homeSection:not(.hidden))::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    height: calc(var(--klevby-bottom-chrome-total) + 34px);
    z-index: 0;
    opacity: 1;
    pointer-events: none;
    background:
      linear-gradient(180deg,
        rgba(6, 17, 26, 0) 0%,
        rgba(6, 17, 26, 0.68) 36%,
        rgba(6, 17, 26, 0.96) 100%
      );
  }
}

@media (max-width: 767px) {
  body:has(#homeSection:not(.hidden)) #klevbyAppRoot > main.wrap {
    width: 100%;
  }

  /*
   * HOME FIXED-FIT TOKENS — standard measured-available-height tier.
   * Spacing remains bounded on tall screens; density overrides are universal.
   */
  :root {
    --klevby-home-content-inset: 22px;
    --klevby-home-surface-border: rgba(88, 108, 124, 0.24);
    --klevby-home-surface-accent-border: rgba(244, 140, 60, 0.10);
    --klevby-home-lower-fill-y: 0px;
    --klevby-home-header-pull: 86px;
    --klevby-home-hero-min-h: 118px;
    --klevby-home-hero-row-max-h: 225px;
    --klevby-home-hero-pad-top: 86px;
    --klevby-home-hero-pad-inline: 26px;
    --klevby-home-hero-pad-bottom: 0px;
    --klevby-home-hero-margin-bottom: 8px;
    --klevby-home-hero-copy-min-h: 124px;
    --klevby-home-hero-copy-shift-x: -10px;
    --klevby-home-hero-copy-shift-y: -126px;
    --klevby-home-hero-copy-nudge-y: 48px;
    --klevby-home-actions-gap-after-hero: 18px;
    --klevby-home-hero-to-quick-grid-gap: 2px;
    --klevby-home-hero-copy-to-quick-gap: 50px;
    --klevby-home-quick-to-feed-gap: 22px;
    --klevby-home-quick-overlap: var(--klevby-home-actions-gap-after-hero);
    --klevby-home-quick-min-h: 121px;
    --klevby-home-section-gap: 14px;
    --klevby-home-feed-group-offset-y: 18px;
    --klevby-home-feed-card-target-h: 224px;
    --klevby-home-feed-card-max-h: 230px;
    --klevby-home-feed-card-min-h: calc(226px + var(--klevby-home-lower-fill-y));
    --klevby-home-feed-card-visual-min-h: 184px;
    --klevby-home-feed-header-h: 34px;
    --klevby-home-feed-row-min-h: calc(var(--klevby-home-feed-card-visual-min-h) + var(--klevby-home-feed-header-h));
    --klevby-home-feed-image-min-h: calc(130px + var(--klevby-home-lower-fill-y));
    --klevby-home-weather-strip-min-h: 58px;
    --klevby-home-bottom-reserve: 0px;
    --klevby-home-header-nudge-y: 0px;
    --klevby-home-weather-nudge-y: 0px;
    --klevby-home-weather-clearance-y: 12px;
  }

  html:has(#homeSection:not(.hidden)) {
    background: #061016;
  }

  header {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-bottom: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  header::before,
  header::after,
  .header-inner::before,
  .header-inner::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .header-inner {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body[data-app-chrome-mode="home"]:has(#homeSection:not(.hidden)) header .header-inner {
    transform: translateY(var(--klevby-home-header-nudge-y));
  }

  body[data-app-chrome-mode="home"] header .app-header-leading,
  body[data-app-chrome-mode="home"] header .mobile-actions {
    transform: translateY(21px);
  }

  /*
   * HOME TOUCHBAR — align to Home content rail and card radius.
   */
  body[data-app-chrome-mode="home"]:has(#homeSection:not(.hidden)) .mobile-tabbar {
    left: var(--klevby-home-content-inset);
    right: var(--klevby-home-content-inset);
  }

  #homeSection:not(.kg-screen) {
    position: absolute !important;
    z-index: 1 !important;
    top: var(--klevby-app-available-top) !important;
    bottom: var(--klevby-app-available-bottom-offset) !important;
    height: var(--klevby-app-available-height) !important;
    min-height: var(--klevby-app-available-height) !important;
    max-height: var(--klevby-app-available-height) !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-top: 0 !important;
    padding-left: calc(50vw - 50%) !important;
    padding-right: calc(50vw - 50%) !important;
    background: transparent !important;
  }

  body[data-home-skeleton="true"] #homeSection.kg-screen[data-home-layout="grid"] {
    position: fixed !important;
    z-index: 1 !important;
    top: var(--klevby-home-available-top, var(--klevby-app-available-top)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    height: var(--klevby-home-available-height, var(--klevby-app-available-height)) !important;
    min-height: 0 !important;
    max-height: var(--klevby-home-available-height, var(--klevby-app-available-height)) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    transform: none !important;
    background: transparent !important;
  }

  #homeSection::before {
    content: none !important;
    display: none !important;
  }

  #homeSection .hero {
    position: relative !important;
    z-index: 1 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 50% !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: var(--klevby-home-hero-margin-bottom) !important;
    transform: translateX(-50%) !important;
    min-height: var(--klevby-home-hero-min-h) !important;
    padding:
      calc(env(safe-area-inset-top) + var(--klevby-home-hero-pad-top))
      var(--klevby-home-hero-pad-inline)
      var(--klevby-home-hero-pad-bottom) !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #homeSection .hero::after {
    border-radius: 0 !important;
    background: none !important;
  }

  #homeSection .hero-copy {
    min-height: var(--klevby-home-hero-copy-min-h) !important;
    width: calc(100vw - (2 * var(--klevby-home-content-inset))) !important;
    margin-left: calc(var(--klevby-home-content-inset) - var(--klevby-home-hero-pad-inline)) !important;
    margin-right: auto !important;
    padding: 0 0 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    transform: translate3d(
      0,
      calc(var(--klevby-home-hero-copy-shift-y) + 23px + var(--klevby-home-hero-copy-nudge-y)),
      0
    ) !important;
  }

  #homeSection .hero-slogan {
    margin: 0 0 5px !important;
    color: rgba(255, 255, 255, 0.96) !important;
    font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 32px !important;
    line-height: 1.30 !important;
    font-weight: 500 !important;
    letter-spacing: -0.012em !important;
    white-space: normal !important;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.3) !important;
  }

  #homeSection .hero-slogan br {
    display: block;
    margin-top: 2px;
    content: "";
  }

  #homeSection .hero-description {
    margin: 0 0 8px !important;
    color: rgba(255, 244, 220, 0.60) !important;
    font-size: 13.5px !important;
    line-height: 1.70 !important;
    font-weight: 400 !important;
    max-width: 20em !important;
    text-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
  }

  #homeSection .hero-description-line--second {
    letter-spacing: -0.005em;
  }

  #homeSection #forecastPanel .forecast-head h2,
  #homeSection .mobile-weather-city::before,
  #homeSection #profileFeedSection.grid::before,
  #feedSection #profileFeedSection.grid::before,
  #homeSection #profileFeedSection.social-feed-grid::before,
  #feedSection #profileFeedSection.social-feed-grid::before{
    font-weight: 950 !important;
    letter-spacing: -0.045em !important;
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.42) !important;
  }

  #homeSection #forecastPanel .forecast-head p,
  #homeSection #forecastPanel #weatherStatus {
    color: rgba(244, 251, 247, 0.66) !important;
    font-weight: 650 !important;
  }

  #homeSection .hero-features {
    display: none !important;
  }

  #homeSection .hero-features-title {
    margin: 0 0 3px !important;
    color: rgba(255, 248, 234, 0.74) !important;
    font-size: 11.5px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    text-shadow: none !important;
  }

  #homeSection .hero-feature-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 2px 10px !important;
  }

  #homeSection .hero-feature-chip {
    appearance: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    color: rgba(255, 248, 234, 0.86) !important;
    font-family: inherit !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: pointer !important;
  }

  #homeSection .hero-feature-chip:active {
    transform: none !important;
    opacity: 0.82 !important;
  }

  #homeSection .home-quick-actions,
  #homeSection .home-feed-preview,
  #homeSection .home-weather-card {
    width: calc(100% - (2 * var(--klevby-home-content-inset)));
    margin-left: auto;
    margin-right: auto;
  }

  #homeSection .home-quick-actions {
    display: block;
    position: relative;
    z-index: 2;
    margin: var(--klevby-home-quick-overlap) auto calc(var(--klevby-home-section-gap) + var(--klevby-home-feed-group-offset-y));
    padding: 0;
  }

  #homeSection .home-quick-actions-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  #homeSection .home-quick-action-card {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 1 / 1;
    gap: 10px;
    margin: 0;
    padding: 12px 6px 12px;
    border: 1px solid var(--klevby-home-surface-border);
    border-radius: 18px;
    background:
      radial-gradient(circle at 50% 0%, rgba(32, 58, 78, 0.14), transparent 52%),
      linear-gradient(180deg, rgba(8, 16, 23, 0.86) 0%, rgba(6, 12, 18, 0.92) 100%);
    color: #fff8ea;
    box-shadow:
      0 12px 28px rgba(0, 8, 16, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      inset 0 0 0 1px var(--klevby-home-surface-accent-border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.16s ease,
      opacity 0.16s ease,
      border-color 0.16s ease;
  }

  #homeSection .home-quick-action-card:active {
    transform: scale(0.97);
    opacity: 0.9;
    border-color: rgba(120, 145, 165, 0.34);
  }

  #homeSection .home-quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(-9px);
  }

  #homeSection .home-quick-action-icon img {
    width: 27px;
    height: 27px;
    display: block;
    opacity: 0.92;
    filter: invert(52%) sepia(72%) saturate(1800%) hue-rotate(353deg) brightness(100%) contrast(95%);
  }

  #homeSection .home-quick-action-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    transform: translateY(-16px);
  }

  #homeSection .home-quick-action-label {
    max-width: 100%;
    color: rgba(255, 248, 234, 0.94);
    font-size: 10.5px;
    line-height: 1.22;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }

  #homeSection .home-quick-action-subtitle {
    max-width: 100%;
    color: rgba(255, 248, 234, 0.52);
    font-size: 9px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
  }

  #homeSection .home-feed-preview {
    display: block;
    position: relative;
    z-index: 2;
    margin: 0 auto var(--klevby-home-section-gap);
    padding: 0;
  }

  #homeSection .home-feed-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 8px;
    transform: translateY(-5px);
  }

  #homeSection .home-feed-preview-head .home-feed-preview-title {
    margin: 0;
    color: #ffffff !important;
    font-family: var(--klevgo-font-display) !important;
    font-size: 19px !important;
    font-weight: 475 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
  }

  #homeSection .home-feed-preview-link {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 248, 234, 0.58);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #homeSection .home-feed-preview-link-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
  }

  #homeSection .home-feed-preview-link-chevron img {
    display: block;
    width: 14px;
    height: 14px;
    transform: scaleX(-1);
    opacity: 0.9;
  }

  #homeSection .home-feed-preview-link:active {
    opacity: 0.82;
  }

  #homeSection .home-feed-preview-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 14px;
    min-height: var(--klevby-home-feed-card-min-h);
    border: 1px solid rgba(244, 178, 74, 0.14);
    border-radius: 18px;
    background:
      radial-gradient(circle at 0% 0%, rgba(244, 122, 43, 0.10), transparent 42%),
      linear-gradient(180deg, rgba(22, 20, 18, 0.94) 0%, rgba(10, 10, 10, 0.98) 100%);
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.30),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.16s ease,
      opacity 0.16s ease,
      border-color 0.16s ease;
  }

  #homeSection .home-feed-preview-card:active {
    transform: scale(0.99);
    opacity: 0.94;
    border-color: rgba(244, 178, 74, 0.26);
  }

  #homeSection .home-feed-preview-slide--feed:active {
    transform: none;
    opacity: 1;
  }

  #homeSection .home-feed-preview-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  #homeSection .home-feed-preview-menu-dots {
    flex: 0 0 auto;
    margin: 2px 0 0;
    pointer-events: none;
    color: rgba(255, 248, 234, 0.36);
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.14em;
    user-select: none;
  }

  #homeSection .home-feed-preview-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
  }

  #homeSection .home-feed-preview-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    min-height: 0;
  }

  #homeSection .home-feed-preview-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding-right: 4px;
  }

  #homeSection .home-feed-preview-avatar {
    display: block;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(244, 122, 43, 0.28);
    background: rgba(244, 122, 43, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  }

  #homeSection .home-feed-preview-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  #homeSection .home-feed-preview-meta-text {
    min-width: 0;
  }

  #homeSection .home-feed-preview-author {
    color: rgba(255, 248, 234, 0.96);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  #homeSection .home-feed-preview-location {
    margin-top: 2px;
    color: rgba(255, 248, 234, 0.56);
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.01em;
  }

  #homeSection .home-feed-preview-text {
    margin: 2px 0 0;
    color: rgba(255, 242, 218, 0.78);
    font-size: 12px;
    line-height: 1.38;
    font-weight: 565;
    letter-spacing: -0.01em;
  }

  #homeSection .home-feed-preview-text-extra {
    display: none;
  }

  #homeSection .home-feed-preview-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding-top: 0;
  }

  #homeSection .home-feed-preview-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
  }

  #homeSection .home-feed-preview-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
  }

  #homeSection .home-feed-preview-action-icon svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  #homeSection .home-feed-preview-action-count {
    color: rgba(255, 242, 218, 0.78);
  }

  #homeSection .home-feed-preview-action--like .home-feed-preview-action-icon {
    color: #f47a2b;
  }

  #homeSection .home-feed-preview-action--comment .home-feed-preview-action-icon {
    color: rgba(255, 242, 218, 0.78);
  }

  #homeSection .home-feed-preview-image {
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: var(--klevby-home-feed-image-min-h);
    align-self: stretch;
    background: rgba(0, 0, 0, 0.24);
  }

  #homeSection .home-feed-preview-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: var(--klevby-home-feed-image-min-h);
    object-fit: cover;
    object-position: center;
  }

  #homeSection .home-feed-preview-rotator {
    position: relative;
    width: 100%;
  }

  #homeSection .home-feed-preview-rotator-viewport {
    position: relative;
    width: 100%;
    min-height: var(--klevby-home-feed-card-min-h);
  }

  #homeSection .home-feed-preview-rotator:not(.is-ready) .home-feed-preview-slide--ad {
    display: none;
  }

  #homeSection .home-feed-preview-rotator.is-ready .home-feed-preview-slide--feed {
    width: 100%;
    transition:
      opacity 0.65s ease,
      visibility 0.65s ease;
  }

  #homeSection .home-feed-preview-rotator.is-ready .home-feed-preview-slide--feed:not(.is-active) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  #homeSection .home-feed-preview-rotator.is-ready .home-feed-preview-slide--feed.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    cursor: default;
  }

  #homeSection .home-feed-preview-rotator.is-ready .home-feed-preview-slide--ad {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.65s ease,
      visibility 0.65s ease;
    z-index: 2;
  }

  #homeSection .home-feed-preview-rotator.is-ready .home-feed-preview-slide--ad.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }

  #homeSection .home-feed-preview-slide--ad {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    cursor: default;
    background: #0a0a0a;
    border-color: rgba(244, 122, 43, 0.22);
  }

  #homeSection .home-feed-preview-slide--ad:active {
    transform: none;
    opacity: 1;
    border-color: rgba(244, 122, 43, 0.22);
  }

  #homeSection .home-feed-ad-bg {
    position: absolute;
    inset: 0;
    background-image: url("../../images/ads/klevgo_ad_slot_bg_fishing_tackle.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: calc(100% + 16px) center;
    z-index: 0;
  }

  #homeSection .home-feed-ad-scrim {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(
        90deg,
        rgba(2, 4, 3, 0.94) 0%,
        rgba(2, 4, 3, 0.82) 42%,
        rgba(2, 4, 3, 0.34) 68%,
        rgba(2, 4, 3, 0.08) 100%
      ),
      linear-gradient(
        180deg,
        rgba(2, 4, 3, 0.18) 0%,
        rgba(2, 4, 3, 0.42) 100%
      );
    z-index: 1;
  }

  #homeSection .home-feed-ad-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 14px 16px 14px;
    max-width: 72%;
    box-sizing: border-box;
  }

  #homeSection .home-feed-ad-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }

  #homeSection .home-feed-ad-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin: 0;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(244, 122, 43, 0.38);
    background: rgba(244, 122, 43, 0.12);
    color: #f47a2b;
    font-size: 8.5px;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }

  #homeSection .home-feed-ad-headline {
    margin: 4px 0 0;
    color: #fff8ea;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.34;
    letter-spacing: -0.03em;
    text-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  }

  #homeSection .home-feed-ad-support {
    margin: 0;
    color: rgba(255, 248, 234, 0.72);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.48;
    letter-spacing: -0.01em;
    text-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
  }

  #homeSection .home-feed-ad-footer {
    margin: auto 0 0;
    padding-top: 10px;
    color: rgba(244, 122, 43, 0.88);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.36;
    letter-spacing: 0.01em;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }

  /*
   * HOME FEED/AD PREVIEW — banner rotator slides; legacy copy hidden, PNG banners shown.
   */
  #homeSection .home-feed-preview-card > * {
    display: none !important;
  }

  #homeSection .home-feed-preview-slide--feed > .home-feed-ad-banner,
  #homeSection .home-feed-preview-slide--ad > .home-feed-ad-banner {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
    pointer-events: none;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
  }

  #homeSection .home-feed-preview-slide--feed {
    position: relative;
    overflow: hidden;
  }

  #homeSection .home-feed-preview-slide--feed > .home-feed-ad-banner {
    z-index: 0;
  }

  #homeSection .home-feed-preview-slide--ad {
    background:
      radial-gradient(circle at 0% 0%, rgba(244, 122, 43, 0.10), transparent 42%),
      linear-gradient(180deg, rgba(22, 20, 18, 0.94) 0%, rgba(10, 10, 10, 0.98) 100%) !important;
    border-color: rgba(244, 178, 74, 0.14) !important;
  }

  #homeSection #forecastPanel.forecast-panel {
    display: none !important;
  }

  #homeSection .home-weather-card {
    display: block;
    position: relative;
    z-index: 2;
    margin: 0 auto var(--klevby-home-section-gap);
    padding: 10px 14px;
    border: 1px solid var(--klevby-home-surface-border);
    border-radius: 16px;
    background:
      radial-gradient(circle at 50% 0%, rgba(32, 58, 78, 0.12), transparent 48%),
      linear-gradient(180deg, rgba(8, 16, 23, 0.86) 0%, rgba(6, 12, 18, 0.92) 100%);
    box-shadow:
      0 10px 24px rgba(0, 8, 16, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      inset 0 0 0 1px var(--klevby-home-surface-accent-border);
    transform: translateY(var(--klevby-home-weather-nudge-y));
  }

  #homeSection:not(.hidden) ~ .footer {
    display: none !important;
  }

  #homeSection .home-weather-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--klevby-home-weather-strip-min-h);
  }

  #homeSection .home-weather-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    column-gap: 12px;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    order: 1;
  }

  #homeSection .home-weather-strip:has(.home-weather-details[open]) .home-weather-main {
    display: none;
  }

  #homeSection .home-weather-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  #homeSection .home-weather-mode-icon {
    display: block;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  #homeSection .home-weather-primary-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    min-width: 0;
  }

  #homeSection .home-weather-chip-temp {
    gap: 0;
    font-size: 22px;
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.04em;
  }

  #homeSection .home-weather-condition {
    margin: 0;
    color: rgba(255, 248, 234, 0.62);
    font-size: 11.5px;
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -0.01em;
  }

  #homeSection .home-weather-divider {
    width: 1px;
    min-height: 38px;
    margin: 2px 0;
    justify-self: stretch;
    align-self: center;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.14) 18%,
      rgba(255, 255, 255, 0.14) 82%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  #homeSection .home-weather-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding-right: 6px;
  }

  #homeSection .home-weather-chip-wind {
    gap: 5px;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 800;
  }

  #homeSection .home-weather-pressure {
    margin: 0;
    color: rgba(255, 248, 234, 0.72);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  #homeSection .home-weather-details {
    display: contents;
  }

  #homeSection .home-weather-details-toggle {
    order: 10;
    flex: 0 0 36px;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 0 0 2px;
    padding: 0;
    list-style: none;
    border: 1px solid rgba(244, 178, 74, 0.18);
    border-radius: 12px;
    background:
      radial-gradient(circle at 30% 0%, rgba(244, 122, 43, 0.14), transparent 52%),
      rgba(12, 18, 16, 0.82);
    color: #f47a2b;
    box-shadow:
      0 6px 14px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #homeSection .home-weather-details-toggle::-webkit-details-marker {
    display: none;
  }

  #homeSection .home-weather-details-toggle::marker {
    content: "";
  }

  #homeSection .home-weather-details-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 0;
    font-size: 0;
  }

  #homeSection .home-weather-chevron-img {
    display: block;
    width: 18px;
    height: 18px;
    transition: transform 0.16s ease;
  }

  #homeSection .home-weather-details[open] .home-weather-chevron-img {
    transform: rotate(180deg);
  }

  #homeSection .home-weather-chip {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    color: rgba(255, 248, 234, 0.94);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
    white-space: nowrap;
    text-align: left;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
  }

  #homeSection .home-weather-chip-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    font-size: 0;
  }

  #homeSection .home-weather-icon-img {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  #homeSection .home-weather-chip-value {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #homeSection .home-weather-chip-bite {
    order: 1;
    flex: 1 1 auto;
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 750;
    pointer-events: none;
  }

  #homeSection .home-weather-details[open] .home-weather-chip-bite {
    display: inline-flex;
  }

  #homeSection .home-weather-chip-bite .home-weather-icon-img {
    width: 20px;
    height: 20px;
  }

  #homeSection .home-weather-bite-label {
    color: rgba(255, 248, 234, 0.72);
    font-weight: 700;
  }

  #homeSection .home-weather-chip-bite .home-weather-chip-value {
    color: #f47a2b;
    font-weight: 850;
  }

  #homeSection .home-weather-details[open] .home-weather-chip-bite {
    flex: 1 1 auto;
    gap: 8px;
    line-height: 1.2;
    align-items: center;
    min-height: 36px;
    min-width: 0;
  }

  #homeSection .home-weather-details[open] .home-weather-bite-label {
    color: rgba(255, 248, 234, 0.94);
  }

  #homeSection .home-weather-strip:has(.home-weather-details[open]) .home-weather-details-toggle {
    margin-left: auto;
  }

  #homeSection #profileFeedSection.grid::before,
  #feedSection #profileFeedSection.grid::before,
  #homeSection #profileFeedSection.social-feed-grid::before,
  #feedSection #profileFeedSection.social-feed-grid::before{
    content: "Лента" !important;
    display: block !important;
  }

  #feedSection #profileFeedSection.grid::before,
  #feedSection #profileFeedSection.social-feed-grid::before {
    content: none !important;
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-title,
  #feedSection #profileFeedSection .profile-feed-title{
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-card,
  #feedSection #profileFeedSection .profile-feed-card{
    position: relative !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    background: rgba(5, 15, 11, 0.96) !important;
    border: 1px solid rgba(244, 178, 74, 0.18) !important;
  }

  #homeSection #profileFeedSection .profile-feed-media,
  #feedSection #profileFeedSection .profile-feed-media{
    position: relative !important;
    overflow: hidden !important;
    background: #06110d !important;
  }

  #homeSection #profileFeedSection .profile-feed-media::after,
  #feedSection #profileFeedSection .profile-feed-media::after{
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: -1px !important;
    height: 96px !important;
    pointer-events: none !important;
    z-index: 2 !important;
    background:
      linear-gradient(
        180deg,
        rgba(4, 17, 12, 0.00) 0%,
        rgba(4, 17, 12, 0.10) 34%,
        rgba(4, 17, 12, 0.38) 68%,
        rgba(4, 17, 12, 0.76) 100%
      ) !important;
  }

  #homeSection #profileFeedSection .profile-feed-image,
  #feedSection #profileFeedSection .profile-feed-image{
    height: clamp(360px, 62vh, 460px) !important;
    min-height: 360px !important;
    max-height: none !important;
    background-size: cover !important;
    background-position: center 38% !important;
    border-radius: 24px 24px 0 0 !important;
  }

  #homeSection #profileFeedSection .profile-feed-image > .profile-feed-image-img,
  #feedSection #profileFeedSection .profile-feed-image > .profile-feed-image-img,
  #homeSection #profileFeedSection .profile-feed-image > .profile-feed-mobile-image-img,
  #feedSection #profileFeedSection .profile-feed-image > .profile-feed-mobile-image-img{
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 38% !important;
    display: block !important;
  }

  #homeSection #profileFeedSection .profile-feed-body,
  #feedSection #profileFeedSection .profile-feed-body{
    position: relative !important;
    z-index: 3 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "author date"
      "actions actions" !important;
    align-items: center !important;
    gap: 13px 12px !important;
    margin-top: 0 !important;
    padding: 16px 18px 18px !important;
    background: rgba(6, 17, 13, 0.96) !important;
    border-top: 1px solid rgba(255, 248, 234, 0.08) !important;
  }

  #homeSection #profileFeedSection .profile-feed-author,
  #feedSection #profileFeedSection .profile-feed-author{
    position: static !important;
    grid-area: author !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-author .profile-feed-avatar-img,
  #feedSection #profileFeedSection .profile-feed-author .profile-feed-avatar-img,
  #homeSection #profileFeedSection .profile-feed-author .profile-feed-avatar-fallback,
  #feedSection #profileFeedSection .profile-feed-author .profile-feed-avatar-fallback{
    width: 40px !important;
    height: 40px !important;
    border: 1px solid rgba(244, 178, 74, 0.24) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25) !important;
  }

  #homeSection #profileFeedSection .profile-feed-author-text,
  #feedSection #profileFeedSection .profile-feed-author-text{
    min-width: 0 !important;
    max-width: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-author-name,
  #feedSection #profileFeedSection .profile-feed-author-name{
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #fff8ea !important;
    font-size: 15.5px !important;
    line-height: 1.12 !important;
    font-weight: 900 !important;
    text-shadow: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-author-action,
  #feedSection #profileFeedSection .profile-feed-author-action{
    display: block !important;
    margin-top: 2px !important;
    color: rgba(255, 248, 234, 0.56) !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
  }

  #homeSection #profileFeedSection .profile-feed-title,
  #feedSection #profileFeedSection .profile-feed-title,
  #homeSection #profileFeedSection .profile-feed-description,
  #feedSection #profileFeedSection .profile-feed-description{
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-tags,
  #feedSection #profileFeedSection .profile-feed-tags{
    grid-area: date !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0 !important;
    max-width: 42vw !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
  }

  #homeSection #profileFeedSection .profile-feed-tags .tag,
  #feedSection #profileFeedSection .profile-feed-tags .tag{
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-tags .tag:last-child,
  #feedSection #profileFeedSection .profile-feed-tags .tag:last-child{
    display: inline-flex !important;
    margin: 0 !important;
    white-space: nowrap !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 248, 234, 0.10) !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.070), rgba(255,255,255,0.030)),
      rgba(3, 13, 10, 0.50) !important;
    color: rgba(255, 248, 234, 0.78) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.05),
      0 8px 18px rgba(0,0,0,0.16) !important;
  }

  #homeSection #profileFeedSection .profile-feed-actions,
  #feedSection #profileFeedSection .profile-feed-actions{
    grid-area: actions !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-open-btn,
  #feedSection #profileFeedSection .profile-feed-open-btn{
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-like-btn,
  #feedSection #profileFeedSection .profile-feed-like-btn,
  #homeSection #profileFeedSection .profile-feed-comment-btn,
  #feedSection #profileFeedSection .profile-feed-comment-btn{
    min-height: 42px !important;
    width: 100% !important;
    padding: 8px 10px !important;
    border-radius: 15px !important;
    border: 1px solid rgba(255, 248, 234, 0.10) !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.030)),
      rgba(3, 13, 10, 0.62) !important;
    color: #fff8ea !important;
    opacity: 1 !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.05),
      0 8px 18px rgba(0,0,0,0.18) !important;
    font-size: 13.5px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    filter: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  #homeSection #profileFeedSection .profile-feed-like-btn.is-liked,
  #feedSection #profileFeedSection .profile-feed-like-btn.is-liked,
  #homeSection #profileFeedSection .profile-feed-like-btn.liked,
  #feedSection #profileFeedSection .profile-feed-like-btn.liked{
    color: #ffd76f !important;
    background:
      linear-gradient(180deg, rgba(255,215,111,0.15), rgba(255,215,111,0.055)),
      rgba(3, 13, 10, 0.66) !important;
    border-color: rgba(255,215,111,0.22) !important;
  }

  #homeSection #profileFeedSection.social-feed-grid,
  #feedSection #profileFeedSection.social-feed-grid{
    position: relative !important;
    z-index: 1 !important;
    margin-top: 2px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #feedSection {
    position: relative;
    z-index: 1;
    isolation: isolate;
    min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  #feedSection::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(circle at 50% 0%, rgba(244, 122, 43, 0.14), transparent 36%),
      linear-gradient(180deg, #171412 0%, #111111 48%, #080808 100%);
  }

  #feedSection .feed-screen-title {
    color: #F47A2B !important;
  }

  #feedSection .feed-screen-shell {
    margin-top: -72px;
  }
}

@media (max-width: 390px) {
  /*
   * HOME FIXED-FIT TOKENS — narrow-width tier (current @max-width:390 tune).
   */
  :root {
    --klevby-home-header-pull: 84px;
    --klevby-home-hero-min-h: 130px;
    --klevby-home-hero-pad-top: 80px;
    --klevby-home-hero-pad-inline: 22px;
    --klevby-home-hero-pad-bottom: 0px;
    --klevby-home-hero-copy-min-h: 124px;
    --klevby-home-hero-copy-shift-y: -116px;
    --klevby-home-weather-strip-min-h: 54px;
  }

  #homeSection .hero {
    margin-top: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #homeSection .hero-slogan {
    font-size: 32px !important;
    line-height: 1.30 !important;
    font-weight: 500 !important;
    letter-spacing: -0.012em !important;
  }

  #homeSection .hero-feature-chips {
    gap: 2px 8px !important;
  }

  #homeSection .hero-feature-chip {
    font-size: 11px !important;
  }

  #homeSection .home-weather-card {
    padding: 8px 12px;
  }

  #homeSection .home-weather-strip {
    gap: 8px;
  }

  #homeSection .home-weather-main {
    column-gap: 10px;
  }

  #homeSection .home-weather-stats {
    padding-right: 4px;
  }

  #homeSection .home-weather-mode-icon {
    width: 30px;
    height: 30px;
  }

  #homeSection .home-weather-chip-temp {
    font-size: 20px;
  }

  #homeSection .home-weather-condition,
  #homeSection .home-weather-pressure {
    font-size: 10.5px;
  }

  #homeSection .home-weather-chip-wind {
    font-size: 11px;
  }

  #homeSection .home-weather-divider {
    min-height: 34px;
  }

  #homeSection .home-weather-details-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  #homeSection .home-weather-chevron-img {
    width: 17px;
    height: 17px;
  }

  #homeSection .home-weather-icon-img {
    width: 21px;
    height: 21px;
  }

  #homeSection .home-weather-chip-bite {
    font-size: 12px;
  }

  #homeSection #profileFeedSection .profile-feed-media::after,
  #feedSection #profileFeedSection .profile-feed-media::after{
    height: 86px !important;
  }

  #homeSection #profileFeedSection .profile-feed-image,
  #feedSection #profileFeedSection .profile-feed-image{
    height: clamp(350px, 60vh, 430px) !important;
    min-height: 350px !important;
    max-height: none !important;
    background-position: center 38% !important;
  }

  #homeSection #profileFeedSection .profile-feed-image > .profile-feed-image-img,
  #feedSection #profileFeedSection .profile-feed-image > .profile-feed-image-img,
  #homeSection #profileFeedSection .profile-feed-image > .profile-feed-mobile-image-img,
  #feedSection #profileFeedSection .profile-feed-image > .profile-feed-mobile-image-img{
    object-position: center 38% !important;
  }

  #homeSection #profileFeedSection .profile-feed-body,
  #feedSection #profileFeedSection .profile-feed-body{
    padding: 15px 16px 17px !important;
    gap: 12px 10px !important;
  }

  #homeSection #profileFeedSection .profile-feed-tags,
  #feedSection #profileFeedSection .profile-feed-tags{
    max-width: 40vw !important;
  }

  #homeSection #profileFeedSection .profile-feed-actions,
  #feedSection #profileFeedSection .profile-feed-actions{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  #homeSection #profileFeedSection .profile-feed-open-btn,
  #feedSection #profileFeedSection .profile-feed-open-btn{
    display: none !important;
  }

  #homeSection #profileFeedSection .profile-feed-like-btn,
  #feedSection #profileFeedSection .profile-feed-like-btn,
  #homeSection #profileFeedSection .profile-feed-comment-btn,
  #feedSection #profileFeedSection .profile-feed-comment-btn{
    min-height: 40px !important;
    padding: 7px 8px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
  }

  body[data-app-chrome-mode="feed"] header,
  body[data-app-chrome-mode="inner"] header,
  body[data-app-chrome-mode="map"] header {
    padding: calc(env(safe-area-inset-top) + 8px) 0 0;
    background: transparent;
  }

  body[data-app-chrome-mode="feed"] header .header-inner,
  body[data-app-chrome-mode="inner"] header .header-inner,
  body[data-app-chrome-mode="map"] header .header-inner {
    min-height: 40px;
    align-items: center;
  }

  body[data-app-chrome-mode="feed"] header .app-header-back-btn,
  body[data-app-chrome-mode="feed"] header .mobile-profile-btn,
  body[data-app-chrome-mode="inner"] header .app-header-back-btn,
  body[data-app-chrome-mode="inner"] header .mobile-profile-btn,
  body[data-app-chrome-mode="map"] header .app-header-back-btn,
  body[data-app-chrome-mode="map"] header .mobile-profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 15px;
  }

  body[data-app-chrome-mode="feed"] header .app-header-back-icon img,
  body[data-app-chrome-mode="inner"] header .app-header-back-icon img,
  body[data-app-chrome-mode="map"] header .app-header-back-icon img {
    width: 18px;
    height: 18px;
  }

  #feedSection {
    position: relative;
    z-index: 1;
    isolation: isolate;
  }

  #feedSection::before {
    background:
      radial-gradient(circle at 50% 0%, rgba(244, 122, 43, 0.12), transparent 34%),
      linear-gradient(180deg, #171412 0%, #101010 50%, #080808 100%);
  }

  #feedSection .feed-screen-shell {
    margin-top: 0;
  }

  #feedSection .feed-screen-header {
    margin: 0 0 4px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  #feedSection .feed-screen-intro {
    padding: 0 2px 2px;
  }

  #feedSection .feed-screen-title {
    margin: 0 0 3px;
    color: #F47A2B !important;
    font-size: 25px;
    font-weight: 950;
    letter-spacing: -0.04em;
    line-height: 1.06;
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  }

  #feedSection .feed-screen-subtitle {
    margin: 0;
    color: rgba(255, 248, 234, 0.72);
    font-size: 13.5px;
    line-height: 1.32;
    font-weight: 650;
  }

  #feedSection #profileFeedSection.grid,
  #feedSection #profileFeedSection.social-feed-grid {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    gap: 12px !important;
  }
}

@media (max-width: 767px) {
  /*
   * HOME FIXED-FIT TOKENS — compact density (670px–719.99px available).
   */
  :root[data-home-density="compact"] {
    --klevby-home-hero-min-h: 116px;
    --klevby-home-hero-row-max-h: 218px;
    --klevby-home-hero-pad-top: 78px;
    --klevby-home-hero-copy-min-h: 120px;
    --klevby-home-hero-copy-shift-y: -108px;
    --klevby-home-quick-min-h: 111px;
    --klevby-home-section-gap: 12px;
    --klevby-home-quick-to-feed-gap: 18px;
    --klevby-home-feed-card-target-h: 206px;
    --klevby-home-feed-card-max-h: 212px;
    --klevby-home-feed-card-min-h: calc(210px + var(--klevby-home-lower-fill-y));
    --klevby-home-feed-card-visual-min-h: 170px;
    --klevby-home-feed-image-min-h: calc(112px + var(--klevby-home-lower-fill-y));
    --klevby-home-weather-strip-min-h: 54px;
    --klevby-home-bottom-reserve: 0px;
    --klevby-home-header-nudge-y: 2px;
    --klevby-home-weather-nudge-y: 0px;
  }

  :root:is([data-home-density="compact"], [data-home-density="tight"]):has(#homeSection:not(.hidden)),
  :root:is([data-home-density="compact"], [data-home-density="tight"]) body:has(#homeSection:not(.hidden)) {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
  }

  :root:is([data-home-density="compact"], [data-home-density="tight"]) body:has(#homeSection:not(.hidden)) {
    padding-bottom: 0;
  }

  :root:is([data-home-density="compact"], [data-home-density="tight"]) body:has(#homeSection:not(.hidden)) #homeSection {
    min-height: var(--klevby-app-available-height);
    max-height: var(--klevby-app-available-height);
    overflow: hidden;
  }

  :root:is([data-home-density="compact"], [data-home-density="tight"]) #homeSection {
    padding-bottom: var(--klevby-home-bottom-reserve);
  }

  :root[data-home-density="compact"] #homeSection .hero-slogan {
    max-width: 100% !important;
    font-size: 30.5px !important;
    line-height: 1.30 !important;
    font-weight: 500 !important;
    letter-spacing: -0.012em !important;
    white-space: normal !important;
  }

  :root[data-home-density="compact"] #homeSection .hero-description {
    font-size: 13.5px !important;
    line-height: 1.70 !important;
    margin-bottom: 6px !important;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-preview-head .home-feed-preview-title {
    font-size: 18.5px !important;
    font-weight: 475 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
  }

  :root[data-home-density="compact"] #homeSection .home-quick-actions-grid {
    gap: 12px;
  }

  :root[data-home-density="compact"] #homeSection .home-quick-action-card {
    padding: 10px 6px;
    gap: 8px;
  }

  :root[data-home-density="compact"] #homeSection .home-quick-action-icon {
    width: 39px;
    height: 39px;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-preview-card {
    padding: 12px;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-preview-content {
    grid-template-columns: minmax(0, 1fr) 110px;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-ad-content {
    padding: 12px 14px 12px;
    gap: 8px;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-ad-copy {
    gap: 8px;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-ad-headline {
    margin-top: 2px;
    font-size: 13.5px;
    line-height: 1.32;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-ad-support {
    font-size: 10px;
    line-height: 1.44;
  }

  :root[data-home-density="compact"] #homeSection .home-feed-ad-footer {
    padding-top: 8px;
    font-size: 9px;
  }
}

@media (min-width: 391px) and (max-width: 767px) {
  /*
   * HOME WEATHER — wider mobile horizontal chrome (391px+).
   * Tighter internal strip layout to match feed preview usable width; no vertical density changes.
   */
  #homeSection .home-weather-strip {
    gap: 8px;
  }

  #homeSection .home-weather-main {
    column-gap: 10px;
  }

  #homeSection .home-weather-stats {
    padding-right: 4px;
  }

  #homeSection .home-weather-details-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 767px) {
  /*
   * HOME FIXED-FIT TOKENS — tight density (<670px available).
   * Reductions are distributed across large blocks while preserving tap targets.
   */
  :root[data-home-density="tight"] {
    --klevby-home-hero-min-h: 114px;
    --klevby-home-hero-row-max-h: 218px;
    --klevby-home-hero-pad-top: 76px;
    --klevby-home-hero-copy-min-h: 108px;
    --klevby-home-hero-copy-shift-y: -96px;
    --klevby-home-hero-copy-nudge-y: 37px;
    --klevby-home-quick-min-h: 107px;
    --klevby-home-section-gap: 12px;
    --klevby-home-feed-group-offset-y: 12px;
    --klevby-home-quick-to-feed-gap: 16px;
    --klevby-home-feed-card-target-h: 178px;
    --klevby-home-feed-card-max-h: 185px;
    --klevby-home-feed-card-min-h: calc(188px + var(--klevby-home-lower-fill-y));
    --klevby-home-feed-card-visual-min-h: 154px;
    --klevby-home-feed-image-min-h: calc(108px + var(--klevby-home-lower-fill-y));
    --klevby-home-weather-strip-min-h: 48px;
    --klevby-home-bottom-reserve: 0px;
    --klevby-home-header-nudge-y: 2px;
    --klevby-home-weather-nudge-y: 0px;
  }

  :root[data-home-density="tight"] #homeSection .hero-slogan {
    max-width: 100% !important;
    font-size: 29.5px !important;
    line-height: 1.30 !important;
    font-weight: 500 !important;
    letter-spacing: -0.012em !important;
    white-space: normal !important;
  }

  :root[data-home-density="tight"] #homeSection .hero-description {
    font-size: 13.5px !important;
    line-height: 1.70 !important;
    margin-bottom: 6px !important;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-preview-head .home-feed-preview-title {
    font-size: 18px !important;
    font-weight: 475 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-preview-text {
    margin-top: 4px;
    line-height: 1.34;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-preview-text-extra {
    display: none;
  }

  :root[data-home-density="tight"] #homeSection .home-quick-actions-grid {
    gap: 12px;
  }

  :root[data-home-density="tight"] #homeSection .home-quick-action-card {
    gap: 8px;
    padding: 9px 6px;
  }

  :root[data-home-density="tight"] #homeSection .home-quick-action-icon {
    width: 39px;
    height: 39px;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-preview-card {
    padding: 11px;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-preview-content {
    grid-template-columns: minmax(0, 1fr) 106px;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-ad-content {
    padding: 11px 13px;
    gap: 8px;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-ad-copy {
    gap: 8px;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-ad-headline {
    margin-top: 2px;
    font-size: 13.5px;
    line-height: 1.32;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-ad-support {
    font-size: 10px;
    line-height: 1.4;
  }

  :root[data-home-density="tight"] #homeSection .home-feed-ad-footer {
    padding-top: 7px;
    font-size: 9px;
  }
}

@media (max-width: 900px) {
  html[data-home-screen-lock="true"],
  body[data-home-screen-lock="true"] {
    height: var(--klevby-app-height, 100dvh) !important;
    min-height: var(--klevby-app-height, 100dvh) !important;
    max-height: var(--klevby-app-height, 100dvh) !important;
    overflow: hidden !important;
    overscroll-behavior-y: none;
  }

  body[data-home-screen-lock="true"] {
    padding-bottom: 0;
  }

  body[data-home-screen-lock="true"] #homeSection:not(.kg-screen):not(.hidden) {
    top: var(--klevby-app-available-top) !important;
    bottom: var(--klevby-app-available-bottom-offset) !important;
    height: var(--klevby-app-available-height) !important;
    min-height: var(--klevby-app-available-height) !important;
    max-height: var(--klevby-app-available-height) !important;
    overflow: hidden !important;
  }
}

/*
 * Real Home grid mode — neutralize legacy flow offsets that predate the shell contract.
 * Loaded before home-grid-foundation.css; foundation owns root geometry and slot rails.
 */
@media (max-width: 767px) {
  #homeSection.kg-screen[data-home-layout="grid"] > .home-feed-preview,
  #homeSection.kg-screen[data-home-layout="grid"] > .home-weather-card {
    margin-top: 0;
    margin-bottom: 0;
    bottom: auto;
  }

  #homeSection.kg-screen[data-home-layout="grid"] > .home-quick-actions {
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
  }

  #homeSection.kg-screen[data-home-layout="grid"] .home-weather-card {
    transform: none;
  }

  #homeSection.kg-screen[data-home-layout="grid"] .home-feed-preview-card,
  #homeSection.kg-screen[data-home-layout="grid"] .home-feed-preview-rotator-viewport,
  #homeSection.kg-screen[data-home-layout="grid"] .home-feed-preview-image,
  #homeSection.kg-screen[data-home-layout="grid"] .home-feed-preview-image img {
    min-height: 0;
    max-height: 100%;
  }
}
