/* Still Here Daily — FREE WEBSITE ONLY, scoped to class assigned by
   free-web-layout.js. No Premium selectors; no hidden functional controls.
   Place after existing site/app stylesheets in free.html. */
html.shd-free-website-compact:not(.shd-native-shell) {
  --shd-free-cream: #fffcf7;
  --shd-free-sage: #e9f0e7;
  --shd-free-forest: #405641;
  --shd-free-text: #344b39;
  --shd-free-border: #d7ddd2;
}

/* Prevent nested page-width and grid items from expanding past the viewport. */
html.shd-free-website-compact:not(.shd-native-shell) body,
html.shd-free-website-compact:not(.shd-native-shell) body .app-main,
html.shd-free-website-compact:not(.shd-native-shell) body .app-container,
html.shd-free-website-compact:not(.shd-native-shell) body .free-app-shell,
html.shd-free-website-compact:not(.shd-native-shell) body #freeContent {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
html.shd-free-website-compact:not(.shd-native-shell) body .free-app-shell {
  width: min(100%, 1060px);
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 24px);
}

/* Free category tiles: compact, centered and consistent at every breakpoint. */
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 12px 0 18px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid > * {
  grid-column: auto !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid .category-button,
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid [data-free-category] {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 7px !important;
  min-height: 88px !important;
  height: auto !important;
  max-height: none !important;
  padding: 12px 10px !important;
  border: 1px solid #c8d3c5 !important;
  border-radius: 14px !important;
  background: var(--shd-free-cream) !important;
  color: var(--shd-free-text) !important;
  box-shadow: 0 2px 7px rgba(40, 56, 38, .05) !important;
  text-align: center !important;
  line-height: 1.25 !important;
  font-size: .92rem !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid .category-button.active,
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid [data-free-category].active,
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid [aria-pressed="true"] {
  background: var(--shd-free-sage) !important;
  border: 2px solid var(--shd-free-forest) !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid .cat-icon,
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid .cat-icon svg {
  width: 28px !important;
  height: 28px !important;
  flex: none !important;
}

/* Wider panels can expand to their CONTENT, never to an arbitrary height. */
html.shd-free-website-compact:not(.shd-native-shell) body .daily-quote-card,
html.shd-free-website-compact:not(.shd-native-shell) body .generator-control-panel,
html.shd-free-website-compact:not(.shd-native-shell) body .generator-result-panel,
html.shd-free-website-compact:not(.shd-native-shell) body .canteen-sample-card,
html.shd-free-website-compact:not(.shd-native-shell) body .premium-preview,
html.shd-free-website-compact:not(.shd-native-shell) body .upgrade-banner,
html.shd-free-website-compact:not(.shd-native-shell) body .shd-discover-section {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin-block: 12px !important;
  padding: clamp(12px, 2.2vw, 18px) !important;
  border-radius: 16px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .generator-layout,
html.shd-free-website-compact:not(.shd-native-shell) body .generator-layout > *,
html.shd-free-website-compact:not(.shd-native-shell) body .generator-result-panel .result-card {
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body .shd-discover-tile {
  box-sizing: border-box !important;
  min-height: 70px !important;
  height: auto !important;
  max-height: none !important;
  padding: 11px 12px !important;
  border-radius: 12px !important;
  overflow-wrap: anywhere !important;
}

/* Mobile: two readable tiles per row; options and output stacked naturally. */
@media (max-width: 650px) {
  html.shd-free-website-compact:not(.shd-native-shell) body .free-app-shell { padding-inline: 12px !important; }
  html.shd-free-website-compact:not(.shd-native-shell) body .free-grid { gap: 8px !important; }
  html.shd-free-website-compact:not(.shd-native-shell) body .free-grid .category-button,
  html.shd-free-website-compact:not(.shd-native-shell) body .free-grid [data-free-category] {
    min-height: 82px !important;
    padding: 9px 7px !important;
    font-size: .88rem !important;
  }
  html.shd-free-website-compact:not(.shd-native-shell) body .generator-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
}
@media (min-width: 651px) {
  html.shd-free-website-compact:not(.shd-native-shell) body .free-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Retain a clear focus ring; all existing click listeners remain intact. */
html.shd-free-website-compact:not(.shd-native-shell) body .free-grid :focus-visible,
html.shd-free-website-compact:not(.shd-native-shell) body .shd-discover-tile:focus-visible {
  outline: 3px solid #a45f4b !important;
  outline-offset: 2px !important;
}

/* V75.26 Free browser-only refinements. Keep all functional controls visible. */
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .app-main > .container {
  min-width: 0;
  max-width: 1120px;
  box-sizing: border-box;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-spotlight {
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  margin: 12px 0 16px !important; border-radius: 16px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-head {
  min-height: 0 !important; padding: 13px 15px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-head h2 {
  font-size: clamp(1.15rem, 3.5vw, 1.36rem) !important;
  line-height: 1.22 !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-items {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important; padding-inline: 13px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-items > div {
  min-width: 0 !important; min-height: 0 !important; height: auto !important;
  padding: 10px 11px !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .locked-feature-grid {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important; gap: 10px !important; max-width: 100%;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .locked-feature-grid > .locked-feature {
  min-width: 0 !important; min-height: 112px !important; height: auto !important;
  padding: 13px 12px !important; border-radius: 14px !important;
  white-space: normal !important; overflow-wrap: anywhere !important;
}
html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .locked-feature-grid > .locked-feature :is(strong,small) {
  line-height: 1.3 !important; overflow-wrap: anywhere !important;
}
@media (max-width: 760px) {
  html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .locked-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important;
  }
  html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .locked-feature-grid > .locked-feature {
    min-height: 100px !important; padding: 11px 10px !important;
  }
}
@media (max-width: 390px) {
  html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .free-grid {
    gap: 8px !important;
  }
  html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] .shd-free-premium-items {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 651px) {
  html.shd-free-website-compact:not(.shd-native-shell) body[data-page="free"] #freeContent .free-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
