/* ALYSSIUN STORE: ratings and comments. Stars on cards and pages, the rating
 * form, the comments with the creator's reply, and the one small "rate it?"
 * card. Tokens only (style.css, sv-base.css): hairlines, glass, small radii.
 * A star is the text colour, never a colour of its own. */
.sv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sv-star { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.1; stroke-linejoin: round; }
.sv-star.is-on { fill: var(--text); stroke: var(--text); }
.sv-stars { display: inline-flex; align-items: center; gap: 2px; }
.sv-rating { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sv-rating strong { color: var(--text); font-weight: 600; }
.sv-card-body .sv-rating { margin-top: 2px; }
.sv-listing-title .sv-rating { margin-top: 8px; font-size: 14px; }
.sv-listing-title .sv-rating .sv-star { width: 16px; height: 16px; }

.sv-ratings { display: grid; gap: 18px; padding-top: clamp(26px, 4vw, 48px); margin-top: clamp(26px, 4vw, 48px); border-top: 1px solid var(--hair); scroll-margin-top: 84px; max-width: 860px; }
.sv-ratings h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 200; }
.sv-ratings-none { margin: 0; color: var(--muted); font-size: 14px; }
.sv-ratings-summary { display: flex; align-items: center; gap: 16px; }
.sv-ratings-summary > strong { font-size: clamp(40px, 6vw, 56px); font-weight: 200; line-height: 1; }
.sv-ratings-summary > div { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.sv-ratings-summary .sv-star { width: 18px; height: 18px; }

.sv-rate-form, .sv-rate-closed { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--hair); border-radius: var(--sv-r-l); background: var(--sv-glass); }
.sv-rate-closed { grid-template-columns: 1fr auto; align-items: center; }
.sv-rate-closed p { margin: 0; color: var(--muted); font-size: 14px; }
.sv-star-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 0; padding: 0; border: 0; min-width: 0; }
.sv-star-pick legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.sv-star-pick label { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.sv-star-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sv-star-pick .sv-star { width: 28px; height: 28px; transition: transform .16s var(--sv-ease); }
.sv-star-pick label:hover .sv-star { transform: scale(1.1); }
.sv-star-pick input:focus-visible ~ .sv-star { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 2px; }
.sv-star-pick[data-value="1"] label:nth-of-type(-n+1) .sv-star, .sv-star-pick[data-value="2"] label:nth-of-type(-n+2) .sv-star,
.sv-star-pick[data-value="3"] label:nth-of-type(-n+3) .sv-star, .sv-star-pick[data-value="4"] label:nth-of-type(-n+4) .sv-star,
.sv-star-pick[data-value="5"] label:nth-of-type(-n+5) .sv-star { fill: var(--text); stroke: var(--text); }
.sv-rate-comment { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.sv-rate-comment textarea { width: 100%; min-height: 84px; resize: vertical; font-size: 16px; }
.sv-rate-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sv-rate-foot .sv-note { margin: 0; }
.sv-rate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.sv-rate-form > .sv-note { margin: 0; }
.sv-rate-state { color: var(--text); }

.sv-comments { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.sv-comment { display: grid; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--hair); min-width: 0; }
.sv-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.sv-comment-head strong { color: var(--text); font-weight: 600; }
.sv-comment-text p, .sv-comment-reply p { margin: 0 0 8px; max-width: 68ch; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.sv-comment-text p:last-child, .sv-comment-reply p:last-child { margin-bottom: 0; }
.sv-comment-reply { display: grid; gap: 6px; margin-left: clamp(0px, 3vw, 24px); padding: 12px 14px; border-left: 1px solid var(--hair-2); background: var(--sv-glass); border-radius: 0 var(--sv-r-m) var(--sv-r-m) 0; }
.sv-comment-reply > span { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.sv-comment-report { justify-self: start; min-width: 44px; min-height: 44px; padding-right: 12px; text-align: left; font-size: 12.5px; }
.sv-comment-report-form label { display: grid; gap: 6px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
#sv-comments-more { justify-self: start; }

/* The prompt: a small card in the corner, above the page and below any dialog. */
.sv-rate-prompt { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px;
  width: min(380px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-l); background: var(--sv-panel); box-shadow: var(--sv-shadow);
  opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .35s var(--sv-ease); }
.sv-rate-prompt.is-on { opacity: 1; transform: none; }
.sv-rate-prompt .sv-app-icon { width: 44px; height: 44px; border-radius: var(--sv-r-m); }
.sv-rate-prompt-text { display: grid; gap: 2px; min-width: 0; }
.sv-rate-prompt-text strong { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-rate-prompt-text > span { color: var(--muted); font-size: 12.5px; }
.sv-rate-prompt-stars { display: flex; margin: 2px 0 0 -9px; }
.sv-rate-prompt-stars a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.sv-rate-prompt-stars .sv-star { width: 26px; height: 26px; }
.sv-rate-prompt-stars a:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; }
.sv-rate-prompt-stars[data-value="1"] a:nth-of-type(-n+1) .sv-star, .sv-rate-prompt-stars[data-value="2"] a:nth-of-type(-n+2) .sv-star,
.sv-rate-prompt-stars[data-value="3"] a:nth-of-type(-n+3) .sv-star, .sv-rate-prompt-stars[data-value="4"] a:nth-of-type(-n+4) .sv-star,
.sv-rate-prompt-stars[data-value="5"] a:nth-of-type(-n+5) .sv-star { fill: var(--text); stroke: var(--text); }
.sv-rate-prompt > .sv-btn { grid-column: 1 / -1; justify-self: end; min-height: 44px; }

/* On a narrower screen the ALYSSIUN button, its first-visit hint and the toast all live at the bottom centre:
 * the card sits under the header instead, so nothing ever covers a star or "Not now". */
@media (max-width: 1119px) and (min-height: 521px) { .sv-rate-prompt { top: calc(116px + env(safe-area-inset-top, 0px)); bottom: auto; transform: translateY(-12px); } .sv-rate-prompt.is-on { transform: none; } }
@media (max-height: 520px) { .sv-rate-prompt { width: min(340px, calc(50vw - 60px)); } }
@media (max-width: 539px) {
  .sv-rate-closed { grid-template-columns: 1fr; }
  .sv-rate-actions { width: 100%; }
  .sv-rate-actions .sv-btn { flex: 1 1 auto; }
  .sv-rate-prompt { left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .sv-rate-prompt, .sv-star-pick .sv-star { transition: none; } .sv-star-pick label:hover .sv-star { transform: none; } }
.sv-rating-link { display: inline-flex; min-height: 28px; align-items: center; }
