/* Browse screens: Home, Library, Search and a person's page. Sizes and
   words: docs/designs/lyra-web-screens.md, sections 3.3 to 3.5. The shared
   pieces (posters, rows, chips, menus) are in lyra.css. */

/* --- grounds --- */
/* Canvas with glow: the glow starts at the window's top, behind the tabs
   when they float there. */
.browse-glow { min-height: calc(100vh - var(--bar) - env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .browse-glow { min-height: 100vh; margin-top: -68px; padding-top: 68px; } }
/* Plain canvas: what scrolls up fades out under the floating tabs. */
.top-fade { display: none; }
@media (min-width: 600px) { .top-fade { display: block; position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 68px; background: linear-gradient(180deg, var(--canvas) 70%, rgba(17,12,21,0)); pointer-events: none; } }

/* --- Home --- */
.home > .page-inner { display: flex; flex-direction: column; gap: var(--home-gap); padding-bottom: 24px; }
.home-head { display: flex; align-items: center; gap: 12px; padding: 8px var(--margin) 0; }
.home-word { font-size: 26px; font-weight: 600; letter-spacing: -.4px; line-height: 34px; }
.home-blocks { display: flex; flex-direction: column; gap: var(--home-gap); }
.home-pad { padding: 0 var(--margin); }

/* a row's arrows: only under a mouse, only while it can go that way */
.shelf-track { position: relative; }
.row-arrow { display: none; position: absolute; z-index: 2; top: calc(4px + var(--poster-w, 124px) * .75); width: 40px; height: 40px; margin-top: -20px; place-items: center; border-radius: 50%; background: rgba(32,24,38,.92); border: 1px solid var(--line); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.4); opacity: 0; transition: opacity .15s ease-out, background .12s ease-out; }
.row-arrow.prev { left: 12px; } .row-arrow.next { right: 12px; }
.row-arrow:hover { background: rgba(52,41,60,.96); }
@media (hover: hover) and (pointer: fine) {
  .row-arrow.can { display: grid; }
  .shelf-track:hover .row-arrow.can { opacity: 1; }
}

/* Today's pick */
.pick-card { position: relative; height: 200px; border-radius: var(--r-card-xl); border: 1px solid var(--line); background: var(--plum-gradient); overflow: hidden; isolation: isolate; }
.pick-card .pic { position: absolute; inset: 0; }
.pick-card .pic.from-poster { inset: 0 0 auto 0; height: auto; margin-top: -28%; }
.pick-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,12,21,.94), rgba(17,12,21,.62) 45%, rgba(17,12,21,0) 80%); }
.pick-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pick-link:focus-visible { outline-offset: -3px; border-radius: var(--r-card-xl); }
.pick-text { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; max-width: 266px; padding: 24px 18px 20px; pointer-events: none; }
.pick-name { font-size: 27px; font-weight: 600; letter-spacing: -.5px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-facts { max-width: 100%; font-size: 13px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-play { display: inline-flex; align-items: center; gap: 7px; height: 40px; margin-top: auto; padding: 0 18px 0 15px; border-radius: 999px; background: #fff; color: #000; font-size: 15px; font-weight: 600; pointer-events: auto; transition: transform .12s ease-out, opacity .12s ease-out; }
.pick-play:active { transform: scale(.98); opacity: .85; }
@media (min-width: 600px) {
  .pick-card { height: 300px; max-width: 900px; }
  .pick-name { font-size: 34px; }
  .pick-text { max-width: 456px; }
}

/* without a connection */
.offline-home, .offline-body { display: flex; flex-direction: column; gap: 18px; }
.offline-banner { display: flex; align-items: center; gap: 12px; margin: 0 var(--margin); padding: 14px; border-radius: var(--r-card-lg); background: var(--field); border: 1px solid var(--line); }
.offline-banner > .icon { color: var(--accent); stroke-width: 2.1; }
.offline-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.offline-words strong { font-size: 15px; font-weight: 600; }
.offline-words span { font-size: 13px; color: var(--secondary); }
.btn.offline-retry { flex: none; width: auto; min-width: 88px; min-height: 34px; padding: 0 8px; font-size: 13px; font-weight: 600; }
.offline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); justify-items: center; gap: 20px 14px; padding: 0 var(--margin); --poster-w: 104px; }
/* "49% on this browser" is longer than the phone's words: it may take a second line */
.offline-grid .poster-sub { white-space: normal; }
.library .offline-home { margin: 0 calc(-1 * var(--margin)); }

/* --- Library --- */
.library { display: flex; flex-direction: column; gap: 16px; padding: 8px var(--margin) 24px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.lib-body { display: flex; flex-direction: column; gap: 16px; }
.filter-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.10); color: #fff; transition: background .12s ease-out, color .15s ease-out; }
.filter-btn:hover { background: rgba(255,255,255,.16); }
.filter-btn .icon { stroke-width: 2.2; }
.filter-btn.on { color: var(--accent); }
@media (min-width: 600px) { .lib-picker { max-width: 400px; } }
.lib-note:empty { display: none; }
/* the count's "Clear" has a full-size press area that must not push the posters down */
.lib-count { display: flex; align-items: center; justify-content: space-between; height: 20px; font-size: 13px; font-weight: 500; color: var(--secondary); }
.lib-count button { min-width: 44px; min-height: 44px; text-align: right; color: var(--text); font-weight: 500; }
.lib-count button:hover, .lib-nomatch button:hover { text-decoration: underline; }
.lib-nomatch { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 40px; font-size: 15px; font-weight: 600; }
.lib-nomatch button { min-height: 44px; font-weight: 600; }

/* the letters down the right edge */
.letter-index-wrap { position: fixed; z-index: 40; top: 12px; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 12px); right: max(0px, calc((100vw - var(--content)) / 2)); width: 26px; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
@media (min-width: 600px) { .letter-index-wrap { top: 80px; bottom: 12px; } }
.letter-index { position: relative; display: flex; flex-direction: column; max-height: 100%; font-size: 11px; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.letter-index:focus-visible { outline-offset: -1px; }
.letter-index span { flex: 0 1 16px; min-height: 0; display: grid; place-items: center; font-weight: 700; line-height: 1; color: var(--secondary); }
.letter-index span.on { color: var(--accent); }
.letter-bubble { position: absolute; right: 40px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-gradient); color: var(--on-accent); font-size: 26px; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.35); pointer-events: none; }

/* --- Search --- */
.search { padding: 8px 0 24px; }
.search-head { display: flex; flex-direction: column; gap: 12px; padding: 0 var(--margin); }
.search-field { display: flex; align-items: center; height: 44px; border-radius: var(--r-field); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease-out; }
.search-field:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,176,138,.85), 0 0 0 4px rgba(255,176,138,.10); }
.search-field > .icon { margin-left: 13px; color: var(--tertiary); }
.search-input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; background: none; font-size: 16px; -webkit-appearance: none; appearance: none; }
.search-input:focus, .search-input:focus-visible { outline: none; }
.search-input::placeholder { color: var(--tertiary); }
.search-input::-webkit-search-cancel-button, .search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-clear { display: grid; place-items: center; width: 42px; height: 100%; color: var(--tertiary); }
.search-clear:hover { color: var(--secondary); }
.search-body { padding-top: 14px; }
.search-browse { padding: 8px 0; }
.search-label { padding: 0 var(--margin); }
.search-pad { padding: 8px var(--margin); }

.recent-clear { font-size: 15px; font-weight: 500; color: var(--accent); }
.recent-clear:hover { text-decoration: underline; }
.recent-list { padding: 6px 8px 18px var(--margin); }
.recent-row { display: flex; align-items: center; }
.recent-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 0; border-radius: 8px; }
.recent-x { display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--tertiary); }
.recent-x .icon { stroke-width: 2.2; }
.recent-x:hover { color: var(--text); }

.search-shelf { padding-bottom: 26px; --poster-w: 104px; }
.search-shelf .h-scroll { gap: 10px; }
.search-chips { padding: 8px var(--margin) 0; }
.search-rows { display: flex; flex-direction: column; gap: 10px; padding: 8px var(--margin); }
.search-rows.genre { padding: 14px var(--margin) 0; }
.search-rows .search-label { padding: 0; }
.search-rows .search-label.first { margin-top: 4px; }
.search-rows .search-label.second { margin-top: 16px; }
.search-none { padding-top: 24px; font-size: 14px; color: var(--secondary); text-align: center; }
.search-row { display: flex; align-items: center; gap: 14px; }
.search-row.card { padding: 10px; transition: background .12s ease-out; }
.search-row.card:hover { background: var(--field-hover); }
.search-row.found { padding: 6px 10px 6px 0; border-radius: 10px; }
.search-row.found .row-name { color: rgba(255,255,255,.864); }
.search-row > .icon { color: var(--tertiary); stroke-width: 2.2; }
.search-row .status-line { margin-top: 3px; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.row-name { max-width: 100%; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--secondary); min-height: 18px; }
/* a small poster in a list: the plum ground and the mark when there is no picture */
.thumb { position: relative; display: grid; place-items: center; flex: none; overflow: hidden; background: var(--plum-gradient); }
.thumb.s34 { width: 34px; height: 51px; border-radius: 5px; }
.thumb.s44 { width: 44px; height: 66px; border-radius: var(--r-thumb); }
.thumb .pic { position: absolute; inset: 0; }
.thumb .mark { opacity: .2; filter: grayscale(1) brightness(3); }
/* wide: the field and the rows keep to a readable width; the shelf and chips use the page */
@media (min-width: 600px) {
  .search-head .search-field, .search-rows, .recent-list, .search-label.label-row { max-width: calc(900px + 2 * var(--margin)); }
  .search-head .search-field { max-width: 900px; }
}

/* --- a person's page --- */
.person-body { display: flex; flex-direction: column; gap: 22px; padding: 0 var(--margin) 30px; }
.person-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; text-align: center; }
.person-photo { position: relative; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; overflow: hidden; background: var(--plum-gradient); border: 1px solid var(--line); color: var(--accent); font-size: 39px; font-weight: 600; }
.person-photo .pic { position: absolute; inset: 0; }
.person-name { font-size: 24px; font-weight: 700; line-height: 1.2; }
.person-count { font-size: 14px; color: var(--secondary); }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); justify-items: center; gap: 18px 14px; --poster-w: 104px; }
.person-wait { display: grid; place-items: center; padding-top: 38px; }
/* inside a title's card on a narrow window: the tabs are covered */
@media (max-width: 599px) { body.cover-person .tabs { display: none; } body.cover-person .page { padding-bottom: 0; } body.cover-person .browse-glow { min-height: 100vh; } }

/* A suggestion row's heading on Home opens the row in full (row.js). */
.heading-link { display: inline-flex; align-items: baseline; gap: 6px; color: inherit; text-decoration: none; }
.heading-link svg { color: var(--tertiary); align-self: center; transition: transform .15s ease; }
.heading-link:hover svg { transform: translateX(2px); color: var(--secondary); }
.rowpage .back-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-body { display: flex; flex-direction: column; gap: 20px; padding: 4px var(--margin) 40px; }
.row-foot { display: grid; place-items: center; min-height: 0; }
.row-foot:not(:empty) { min-height: 44px; }
.row-end { height: 1px; }

/* --- Lyra AI (ai.js; the iPhone's AskView) --- */
.search-row.ask-row { width: 100%; padding: 12px 10px 12px 0; border-radius: 10px; text-align: left; }
.ask-mark { display: grid; place-items: center; width: 44px; flex: none; color: var(--text); }
.ask-mark .icon { stroke-width: 1.6; }
.ask-row .row-name { font-size: 16px; }
.ask-row .row-sub { max-width: 100%; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the sheet that asks a user before its first question */
.ask-privacy { align-self: flex-start; margin: -4px 0 8px; color: var(--accent); font-size: 14px; font-weight: 500; text-decoration: none; }
.ask-privacy:hover { text-decoration: underline; }

.ask { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
@media (min-width: 600px) { .ask { min-height: calc(100dvh - 68px); } }
@media (max-width: 599px) { body.cover-ask .tabs { display: none; } body.cover-ask .page { padding-bottom: 0; } }
.ask-list, .ask-foot { width: 100%; max-width: calc(900px + 2 * var(--margin)); }
.ask-list { flex: 1; padding: 0 var(--margin) 24px; }
.ask-x { display: flex; flex-direction: column; align-items: flex-start; }
.ask-you { align-self: flex-end; max-width: min(78%, 420px); margin-top: 16px; padding: 10px 14px; border-radius: 20px 20px 6px 20px; background: rgba(255,255,255,.10); font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-say { margin-top: 16px; font-size: 16px; line-height: 1.45; }
.ask-dots { display: flex; gap: 6px; margin-top: 18px; height: 20px; align-items: center; }
.ask-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); animation: ask-dot 1.4s ease-in-out infinite; }
.ask-dots i:nth-child(2) { animation-delay: .18s; } .ask-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes ask-dot { 0%, 100% { opacity: .35; } 40% { opacity: 1; } }
.ask-picks { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 16px; }
.ask-label { margin-top: 22px; }
.ask-label + .ask-picks { margin-top: 12px; }
.ask-pick { position: relative; display: flex; align-items: flex-start; gap: 14px; }
.ask-pick.in { animation: ask-in .2s ease-out; }
@keyframes ask-in { from { opacity: 0; } }
.thumb.s62 { width: 62px; height: 93px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--hairline); }
.ask-pick .row-text { padding-top: 2px; gap: 3px; }
.ask-pick .row-name { font-size: 16px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ask-pick .row-sub { color: var(--tertiary); }
/* the name's link covers the row; the Wishlist button sits above it */
.ask-link { position: static; max-width: 100%; }
.ask-link::after { content: ""; position: absolute; inset: -4px; border-radius: 10px; }
.ask-link:focus-visible { outline: none; }
.ask-link:focus-visible::after { outline: 2px solid rgba(255,176,138,.85); }
.ask-pick:hover .row-name { text-decoration: underline; text-decoration-color: var(--tertiary); text-underline-offset: 3px; }
.ask-why { margin-top: 3px; font-size: 14px; color: rgba(255,255,255,.75); }
.ask-extra { position: relative; z-index: 1; margin-top: 6px; }
.ask-wish { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); font-size: 14px; font-weight: 600; transition: background .12s ease-out; }
.ask-wish:hover { background: rgba(255,255,255,.08); }
.ask-wish:disabled { opacity: .5; }
.ask-wish .icon { stroke-width: 2.2; }
.ask-note { margin-top: 16px; font-size: 14px; color: var(--tertiary); }
.ask-error { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 15px; color: var(--secondary); }
.ask-retry { min-height: 30px; font-weight: 600; color: var(--text); }
.ask-retry:hover { text-decoration: underline; }

/* chips and the field, held at the bottom, with a short fade above */
.ask-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--canvas); }
.ask-foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; background: linear-gradient(180deg, rgba(17,12,21,0), var(--canvas)); pointer-events: none; }
@media (min-width: 600px) { .ask-foot { padding-left: calc(var(--margin) - 8px); padding-right: calc(var(--margin) - 8px); padding-bottom: 16px; } }
.ask-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px; padding: 0 20px; scrollbar-width: none; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-chips .chip { flex: none; height: 34px; padding: 0 14px; white-space: nowrap; }
@media (min-width: 600px) { .ask-chips { margin: 0; padding: 0 8px; } }
.ask-composer { display: flex; align-items: flex-end; gap: 10px; min-height: 50px; padding: 8px 8px 8px 18px; border-radius: 25px; background: #221a2b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: box-shadow .15s ease-out; }
.ask-composer:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,176,138,.85), 0 0 0 4px rgba(255,176,138,.10); }
.ask-input { flex: 1; min-width: 0; height: 34px; max-height: 96px; padding: 6px 0; border: 0; background: none; resize: none; font: 17px/23px var(--font); color: var(--text); }
.ask-input:focus, .ask-input:focus-visible { outline: none; }
.ask-input::placeholder { color: var(--tertiary); }
.ask-send { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--on-accent); }
.ask-send .icon { stroke-width: 2.6; }
.ask-send:disabled { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .ask-dots i, .ask-pick.in { animation: none; } .ask-dots i { opacity: .7; } }

