/* Reviews on the download page — 2026-08-31, implementing the "نظر کاربران"
   section of the owner's Claude Design draft `PDM Download Page.dc.html`.

   The draft is dark-only with fixed hex; this page also renders light, so
   every colour maps to a site token. The star gold is the one deliberate
   constant: a rating star is gold in every theme, the way it is everywhere
   else on the web. */

.rv-star { fill: color-mix(in srgb, var(--fg) 18%, transparent); flex-shrink: 0; }
.rv-star.is-on { fill: #ffb524; }
.rv-stars { display: inline-flex; gap: 2px; }
.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.rv-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 16px; align-items: start; }

/* ---- summary + form ------------------------------------------------------ */
.rv-side { border: 1px solid var(--border); border-radius: 18px; background: var(--card); padding: 26px 24px; }
.rv-avg-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rv-avg { font-size: 50px; font-weight: 800; color: var(--primary); line-height: 1; }
.rv-count { margin-top: 7px; font-size: 12px; color: var(--muted); }

.rv-dist { margin-top: 22px; display: flex; flex-direction: column; gap: 5px; }
.rv-dist-row {
    display: flex; align-items: center; gap: 11px;
    padding: 6px 9px; border: 1px solid transparent; border-radius: 9px;
    color: inherit; transition: background .2s, border-color .2s;
}
.rv-dist-row:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); color: inherit; }
.rv-dist-row.is-on { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.rv-dist-k { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rv-dist-track { flex: 1; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--fg) 8%, transparent); overflow: hidden; display: block; }
.rv-dist-fill { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.rv-dist-n { width: 22px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); flex-shrink: 0; }

.rv-filter-line { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-filter-lbl { font-size: 11.5px; color: var(--muted); }
.rv-filter-val { font-size: 12px; font-weight: 700; color: var(--primary); }
.rv-clear {
    height: 26px; padding: 0 11px; display: inline-flex; align-items: center;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 11px; font-weight: 600; color: var(--muted);
}
.rv-clear:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 4%, transparent); }

/* The honest stand-in while no review is approved yet. */
.rv-empty-side { text-align: center; padding: 6px 0 4px; }
.rv-empty-n { font-size: 44px; font-weight: 800; color: var(--primary); line-height: 1; }
.rv-empty-side p { margin: 8px auto 0; max-width: 240px; font-size: 12.5px; line-height: 2; color: var(--muted); }

.rv-form-box { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.rv-form-t { font-size: 14.5px; font-weight: 800; }
.rv-form-d { margin-top: 6px; font-size: 11.5px; line-height: 1.9; color: var(--muted); }

.rv-rate { border: 0; margin: 16px 0 0; padding: 0; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rv-star-lbl { cursor: pointer; display: flex; padding: 2px; border-radius: 6px; }
.rv-star-lbl:hover .rv-star { fill: #ffb524; }
/* A checked radio golds its own star and every star before it. Written with
   the sibling combinator so it works with no JavaScript at all. */
.rv-rate input:checked ~ .rv-star-lbl .rv-star { fill: color-mix(in srgb, var(--fg) 18%, transparent); }
.rv-rate input:checked + .rv-star-lbl .rv-star { fill: #ffb524; }
#rv-star-1:checked ~ label[for="rv-star-1"] .rv-star,
#rv-star-2:checked ~ label[for="rv-star-1"] .rv-star, #rv-star-2:checked ~ label[for="rv-star-2"] .rv-star,
#rv-star-3:checked ~ label[for="rv-star-1"] .rv-star, #rv-star-3:checked ~ label[for="rv-star-2"] .rv-star, #rv-star-3:checked ~ label[for="rv-star-3"] .rv-star,
#rv-star-4:checked ~ label[for="rv-star-1"] .rv-star, #rv-star-4:checked ~ label[for="rv-star-2"] .rv-star, #rv-star-4:checked ~ label[for="rv-star-3"] .rv-star, #rv-star-4:checked ~ label[for="rv-star-4"] .rv-star,
#rv-star-5:checked ~ label[for="rv-star-1"] .rv-star, #rv-star-5:checked ~ label[for="rv-star-2"] .rv-star, #rv-star-5:checked ~ label[for="rv-star-3"] .rv-star, #rv-star-5:checked ~ label[for="rv-star-4"] .rv-star, #rv-star-5:checked ~ label[for="rv-star-5"] .rv-star { fill: #ffb524; }
.rv-rate input:focus-visible + .rv-star-lbl { outline: 2px solid var(--primary); outline-offset: 2px; }
.rv-rate-msg { margin-inline-start: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rv-rate-msg.is-set { color: #ffb524; }
.rv-rate-msg.is-err { color: var(--danger, #e5484d); }

.rv-input {
    display: block; width: 100%; margin-top: 10px;
    padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg2); color: var(--fg);
    font: inherit; font-size: 12.5px; outline: none;
}
.rv-input:focus { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.rv-area { line-height: 2; resize: vertical; min-height: 92px; }
.rv-err { margin: 8px 0 0; font-size: 11.5px; font-weight: 600; color: var(--danger, #e5484d); }
.rv-ok {
    display: flex; align-items: center; gap: 8px; margin: 12px 0 0;
    padding: 10px 13px; border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent);
    background: color-mix(in srgb, var(--accent2) 8%, transparent);
    font-size: 11.5px; font-weight: 600; color: var(--accent2); line-height: 1.8;
}
.rv-send { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rv-count-n { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rv-moderation { margin: 10px 0 0; font-size: 11px; line-height: 1.9; color: var(--muted); }
.rv-hp { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#rv-form.is-busy { opacity: .55; pointer-events: none; }

/* ---- cards --------------------------------------------------------------- */
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-card { border: 1px solid var(--border); border-radius: 16px; background: var(--card); padding: 20px 22px; transition: border-color .2s; }
.rv-card:hover { border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.rv-card-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.rv-ava {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
}
/* The name is the only thing in this column now that the date is gone. */
.rv-who { min-width: 0; display: flex; align-items: center; }
.rv-name { font-size: 13.5px; font-weight: 700; }
.rv-card-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-ver {
    height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 16px;
    border: 1px solid var(--border); background: var(--bg2);
    font-family: ui-monospace, Consolas, "JetBrains Mono", monospace;
    font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.rv-body { margin: 14px 0 0; font-size: 13.5px; line-height: 2.1; color: var(--fg); opacity: .9; }

.rv-empty {
    padding: 48px 20px; text-align: center; color: var(--muted);
    border: 1px dashed var(--border); border-radius: 16px;
}
.rv-empty p { margin: 12px 0 0; font-size: 13px; line-height: 2; }
.rv-empty svg { color: color-mix(in srgb, var(--primary) 60%, transparent); }

.rv-pager { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 6px; flex-wrap: wrap; }
.rv-page-btn {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 9px;
    color: var(--muted); font-size: 13px; font-weight: 700;
}
.rv-page-btn:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); color: var(--fg); }
.rv-page-btn.is-on { background: var(--primary); border-color: var(--primary); color: var(--card); }
.rv-page-btn.is-off { opacity: .35; pointer-events: none; }

/* ---- post-download prompt ------------------------------------------------ */
@keyframes rv-toast-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.rv-toast {
    position: fixed; z-index: 80; inset-inline-start: 24px; bottom: 24px;
    width: min(340px, calc(100vw - 32px));
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: 16px; box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .55);
    padding: 18px 20px;
    animation: rv-toast-in .45s cubic-bezier(.2, .7, .3, 1) both;
}
.rv-toast[hidden] { display: none; }
.rv-toast-head { display: flex; align-items: flex-start; gap: 12px; }
.rv-toast-head img { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; }
.rv-toast-t { font-size: 13.5px; font-weight: 800; line-height: 1.6; }
.rv-toast-d { margin-top: 5px; font-size: 11.5px; line-height: 1.9; color: var(--muted); }
.rv-toast-x {
    width: 24px; height: 24px; flex-shrink: 0; margin-inline-start: auto;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer;
}
.rv-toast-x:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 7%, transparent); }
.rv-toast-stars {
    margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 9px; border-radius: 11px;
    background: color-mix(in srgb, var(--fg) 3%, transparent); border: 1px solid var(--border);
}
.rv-toast-star { border: 0; background: transparent; cursor: pointer; padding: 2px; display: flex; transition: transform .15s; }
.rv-toast-star:hover { transform: scale(1.22); }
.rv-toast-star:hover .rv-star { fill: #ffb524; }

@media (prefers-reduced-motion: reduce) {
    .rv-toast { animation: none; }
    .rv-toast-star, .rv-toast-star:hover { transition: none; transform: none; }
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
    .rv-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .rv-side { padding: 22px 18px; }
    .rv-card { padding: 18px 16px; }
    .rv-avg { font-size: 40px; }
    .rv-card-right { margin-inline-start: 0; width: 100%; }
    .rv-toast { inset-inline: 16px; bottom: 16px; width: auto; }
    .rv-send .btn { width: 100%; justify-content: center; }
}

/* A refused submit has to be visible: the stars get a warning ring and every
   message the server sent is listed above the button. */
.rv-rate.is-err { outline: 1px solid color-mix(in srgb, var(--danger, #e5484d) 55%, transparent); outline-offset: 6px; border-radius: 8px; }
.rv-errors { margin-top: 10px; padding: 10px 13px; border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--danger, #e5484d) 35%, transparent);
    background: color-mix(in srgb, var(--danger, #e5484d) 7%, transparent); }
.rv-errors[hidden] { display: none; }
.rv-errors .rv-err { margin: 0; }
.rv-errors .rv-err + .rv-err { margin-top: 5px; }
