/* Cream/forest look for inner app pages (Library, History). Loads after home-m2.css. */
.m2-inner .tb-search { display: block; flex: 0 1 240px; }
.m2-inner .tb-link, .m2-inner .tb-pricing-m, .m2-inner .tb-cta { display: none; }
.m2-lib .tb-search { display: none; }
.m2 .shell-footer { background: transparent; border-top-color: var(--border); position: relative; z-index: 1; }
@media (max-width: 860px) {
  .m2-inner .tb-search { flex: 1 1 100%; }
  .m2-inner .tb-search input { width: 100%; padding: 0 14px 0 38px; cursor: text; }
  .m2-inner .tb-search input::placeholder { color: var(--muted-light); }
  .m2-inner .shell-content { padding-left: 16px; padding-right: 16px; }
}
.m2-inner .shell-footer-grid a, .m2-inner .shell-footer a { display: flex; align-items: center; min-height: 36px; }

/* ===== spacing pass ===== */
@media (max-width: 860px) {
  .m2-lib .lib-rail { margin: 0; }
  .m2-inner .gen-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .m2-inner .gen-stats > * { padding: 12px 10px; min-width: 0; }
  .m2-inner:not(.m2-lib) .tb-search { display: none; }
}
.m2-inner:not(.m2-lib) .tb-search { display: none; } /* History: the library search crowded the nav */

/* History: search box was 280px tall on phones (flex-basis became height in a column) */
@media (max-width: 560px) { .m2-inner .gen-search-wrap { flex: none; } }
@media (max-width: 860px) { .m2-inner .gen-filter { min-height: 40px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; } }

/* ===== Library (cream/green) ===== */
/* "Upgrade to Pro" in the free-library note: a green button, not an orange link */
.m2 .lib-tier-note { text-align: center; }
.m2 .lib-tier-note br { display: none; }
.m2 .lib-tier-note a { display: flex; width: fit-content; margin: 12px auto 0; justify-content: center; text-align: center; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--accent-2); color: #fff !important; font-weight: 600; text-decoration: none !important; box-shadow: 0 6px 16px -8px rgba(31,77,58,.6); }
.m2 .lib-tier-note a:hover { background: var(--accent-2-dark); }

/* Categories on phones: a clean swipeable chip row, no boxed card */
@media (max-width: 1000px) {
  .m2-lib .lib-rail { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 2px 16px 10px; margin-inline: -16px; gap: 8px; align-items: center; -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); }
  .m2-lib .lib-rail-head { display: none; }
  .m2-lib #lib-rail-list { gap: 8px; }
  .m2-lib .lib-rail-item { width: auto; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: .9rem; font-weight: 500; white-space: nowrap; box-shadow: none; }
  .m2-lib .lib-rail-item:hover { background: #fff; border-color: var(--accent-2); }
  .m2-lib .lib-rail-item.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
  .m2-lib .lib-rail-count { opacity: .55; }
  .m2-lib .lib-rail-item.active .lib-rail-count { opacity: .8; }
}
@media (max-width: 640px) {
  /* the search box already says how many prompts there are */
  .m2-lib .lib-count { display: none; }
  .m2-lib .lib-search, .m2-lib .lib-toolbar > * { flex: 1 1 100%; }
}
