/* Review editor: ONE look for writing a review, shared by the company page modal
   (business_detail.html #reviewModal) and the global "Write a Review" pop-up
   (base.html #qrm-panel). Moved out of business_detail.html 2026-11-10 so the two
   can never drift apart again. Edit here only. */
/* ── Review editor modal ── */
.rv-editor-top {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 20px 16px; border-bottom: 1px solid #f1f5f9;
    position: relative;
}
.rv-editor-avatar {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    border: 1.5px solid #e2e8f0; object-fit: cover; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #94a3b8; overflow: hidden;
}
.rv-editor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rv-editor-biz-name { font-size: 0.9375rem; font-weight: 700; color: #0f172a; margin: 0 0 1px; }
.rv-editor-biz-cat { font-size: 0.72rem; color: #94a3b8; margin: 0; }
.rv-editor-close {
    position: absolute; top: 16px; right: 16px;
    background: #f1f5f9; border: none; color: #64748b;
    width: 30px; height: 30px; border-radius: 50%; font-size: 0.85rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.rv-editor-close:hover { background: #e2e8f0; color: #0f172a; }

/* ── Star picker ── */
.rv-star-section {
    padding: 20px 20px 4px; text-align: center;
}
.rv-star-label {
    font-size: 0.7rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px;
}
.rv-stars {
    display: inline-flex; gap: 4px; justify-content: center;
}
.rv-stars i {
    font-size: 2.4rem; color: #cbd5e1; cursor: pointer;
    transition: color 0.12s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    /* fixed box: the solid and outline glyphs differ in width, and in a centred row that
       shifted every star between touch and click, so a tap landed on the neighbour */
    width: 1.2em; text-align: center; touch-action: manipulation;
}
/* 2026-11-27: a chosen star is SOLID gold (FA solid face = weight 900); unchosen ones stay a grey
   outline. Before, every star was the outline glyph and "lit" only recoloured it, so a tap looked
   like nothing happened. Hover only on real pointers: on phones :hover sticks after a tap. */
.rv-stars i.lit { color: #f59e0b; font-weight: 900; }
@media (hover: hover) { .rv-stars i:hover { color: #f59e0b; } }
.rv-stars i:active { transform: scale(0.88); }
.rv-rating-caption {
    font-size: 0.875rem; font-weight: 700; color: #64748b;
    margin: 10px 0 0; min-height: 1.3em; transition: color 0.15s;
    letter-spacing: -0.01em;
}

/* ── Editor writing area ── */
.rv-editor-body { padding: 16px 20px 20px; }
.rv-editor-field {
    position: relative; border: 1.5px solid #e2e8f0; border-radius: 16px;
    background: #f8fafc; transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.rv-editor-field:focus-within {
    border-color: #3b82f6; background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.rv-editor-textarea {
    width: 100%; min-height: 130px; max-height: 260px;
    padding: 14px 14px 40px; border: none; background: transparent;
    font-size: 0.9375rem; font-family: inherit; color: #1e293b;
    resize: none; outline: none; line-height: 1.6;
    box-sizing: border-box; display: block;
    overflow-y: auto;
}
.rv-editor-textarea::placeholder { color: #b0bac9; }
.rv-editor-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px 8px; border-top: 1px solid #f1f5f9;
}
.rv-char-count { font-size: 0.72rem; font-weight: 600; color: #b0bac9; transition: color 0.15s; }
.rv-char-count.warn { color: #f97316; }
.rv-char-count.ok { color: #22c55e; }
/* low-rating note: one small quiet line (owner 2026-11-27); the greyed Publish button carries the message */
.rv-low-rating-hint {
    display: none; padding: 0; margin: 6px 2px 0; background: none; border: 0;
    font-size: 0.72rem; color: #94a3b8; line-height: 1.4;
}
.rv-low-rating-hint i { display: none; }
/* Publish is greyed and cannot be tapped until a 1 to 3 star review has text (review-editor.js gate) */
.rv-btn-submit.is-gated { opacity: .42; pointer-events: none; cursor: not-allowed; filter: saturate(.6); }
.rv-actions {
    display: flex; gap: 10px; margin-top: 14px;
}
.rv-btn-cancel {
    flex: 1; padding: 0.7rem 1rem; background: #f1f5f9; color: #475569;
    border: none; border-radius: 12px; font-size: 0.875rem; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.rv-btn-cancel:hover { background: #e2e8f0; }
.rv-btn-submit {
    flex: 2; padding: 0.7rem 1rem; background: #059669; color: #fff;
    border: none; border-radius: 12px; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    letter-spacing: -0.01em;
}
.rv-btn-submit:hover { background: #047857; }
.rv-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }


.rv-editor-biz-name .verified-badge-icon { width: 15px; height: 15px; min-width: 15px; min-height: 15px; margin-left: 5px; vertical-align: -2px; }
[data-theme="dark"] .rv-btn-cancel { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .rv-btn-cancel:hover { background: #475569; }
[data-theme="dark"] .rv-stars i { color: #475569; }
[data-theme="dark"] .rv-stars i.lit { color: #f59e0b; }
[data-theme="dark"] .rv-editor-top { border-bottom-color: #334155; }
[data-theme="dark"] .rv-editor-close { background: #334155; color: #94a3b8; }
[data-theme="dark"] .rv-editor-close:hover { background: #475569; color: #f1f5f9; }
[data-theme="dark"] .rv-editor-biz-name { color: #f1f5f9; }
[data-theme="dark"] .rv-editor-avatar { background: #0f172a; border-color: #334155; color: #64748b; }
[data-theme="dark"] .rv-editor-field { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .rv-editor-field:focus-within { border-color: #3b82f6; background: #0f172a; }
[data-theme="dark"] .rv-editor-textarea { color: #f1f5f9; }
[data-theme="dark"] .rv-editor-textarea::placeholder { color: #475569; }
[data-theme="dark"] .rv-editor-toolbar { border-top-color: #334155; }

/* ── Public full-page forms (2026-11-13): share-link review page + QR feedback page use
   core/includes/review_editor_fields.html inside .rv-page-card, with static/js/review-editor.js ── */
.rv-page-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06), 0 1px 4px rgba(15,23,42,0.06);
    width: 100%; max-width: 520px; margin: 0 auto; overflow: hidden; box-sizing: border-box;
    text-align: left;
}
h1.rv-editor-biz-name { line-height: 1.3; }
.rv-page-notice {
    margin: 14px 20px 0; padding: 10px 14px; border-radius: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; color: #475569;
    font-size: 0.8rem; line-height: 1.5;
}
.rv-page-notice i { color: #64748b; margin-right: 4px; }
.rv-field-error { display: none; color: #ef4444; font-size: 0.75rem; margin-top: 8px; }
.rv-server-error {
    margin: 0 0 12px; padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 10px; color: #dc2626; font-size: 0.8rem; line-height: 1.5;
}
a.rv-btn-cancel { display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.rv-stars i:focus-visible { outline: 2px solid #059669; outline-offset: 3px; border-radius: 4px; }
/* photo row in the editor toolbar: character counter LEFT, camera button far RIGHT with thumbnails
   just left of it (user, 2026-11-13). Done with order so every form using the markup follows. */
.rv-attach-row { display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; min-width: 0; order: 2; }
.rv-editor-toolbar .rv-char-count { order: 1; }
.rv-attach {
    position: relative; width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
    border: 1px solid #e2e8f0; background: #fff; color: #64748b;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 0.85rem; transition: border-color .15s, color .15s, background .15s;
}
.rv-attach:hover, .rv-attach:focus-visible { border-color: #059669; color: #059669; background: #ecfdf5; outline: none; }
.rv-attach.is-full { opacity: .45; cursor: not-allowed; }
.rv-attach.is-busy { opacity: .6; pointer-events: none; }
.rv-attach-count {
    position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: #059669; color: #fff; font-size: 10px; font-weight: 700;
    line-height: 16px; text-align: center; box-sizing: border-box;
}
.rv-thumbs { display: flex; gap: 6px; }
.rv-thumb { position: relative; width: 32px; height: 32px; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; background: #f1f5f9; flex: 0 0 32px; }
.rv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-thumb button { position: absolute; top: 1px; right: 1px; width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: rgba(15,23,42,.72); color: #fff; font-size: 11px; line-height: 14px; cursor: pointer; }
.rv-attach-msg { font-size: 0.75rem; color: #b45309; margin-top: 6px; }
@media (max-width: 480px) {
    .rv-page-card .rv-actions { flex-direction: column-reverse; }
    .rv-page-card .rv-actions > * { flex: none; width: 100%; }
}
[data-theme="dark"] .rv-page-card { background: #1e293b; border-color: #334155; box-shadow: none; }
[data-theme="dark"] .rv-page-notice { background: #0f172a; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .rv-attach { background: #0f172a; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .rv-thumb { border-color: #334155; background: #0f172a; }
