/* One segmented control: Like, Dislike and Comments share an outline, split by hairlines, with softly squared corners. */
.rate { display: inline-flex; align-items: stretch; font-size: 13px; color: #d1c7b5; border: 1px solid #ffffff24; border-radius: 8px; background: #ffffff06; overflow: hidden; }
.rate-action { display: inline-flex; align-items: center; gap: 6px; min-height: 0; min-width: 0; padding: 6px 12px; border: 0; border-radius: 0; background: transparent; color: #c9bfb3; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.rate-action + .rate-action { border-left: 1px solid #ffffff24; }
.rate-action:hover { background: #ffffff0f; color: #f4ece2; }
.rate-action b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rate-icon { width: 15px; height: 15px; flex-shrink: 0; }
.rate-action[aria-pressed="true"] .rate-icon { fill: currentColor; fill-opacity: .18; }
.rate-who .rate-icon { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.rate-heading { display: flex; align-items: center; gap: 6px; }
.rate-action[data-vote="up"][aria-pressed="true"] { color: #4ade80; background: #22c55e1a; }
.rate-action[data-vote="down"][aria-pressed="true"] { color: #f87171; background: #ef44441a; }

/* Vote buttons inside the sheet */
.rate-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 0; min-width: 0; padding: 2px 9px; border: 1px solid #ffffff1a; border-radius: 999px; background: #ffffff0a; color: inherit; font-size: 12px; line-height: 1.6; cursor: pointer; }
.rate-btn[data-vote="up"] { color: #86efac; border-color: #22c55e40; }
.rate-btn[data-vote="down"] { color: #fca5a5; border-color: #ef444440; }
.rate-btn[data-vote="up"][aria-pressed="true"] { background: #16a34a; border-color: #22c55e; color: #fff; }
.rate-btn[data-vote="down"][aria-pressed="true"] { background: #dc2626; border-color: #ef4444; color: #fff; }

/* Shared sheet: slides up from the bottom on phones, a centered card on bigger screens */
.rate-sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: #000000a6; backdrop-filter: blur(3px); }
.rate-sheet[hidden] { display: none; }
.rate-sheet-panel { width: 100%; max-height: 82vh; display: flex; flex-direction: column; background: #1a1515; border: 1px solid #cbb89a40; border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px #000a; color: #e8dfd2; font: 14px/1.5 'Inter', system-ui, sans-serif; }
.rate-sheet-panel header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid #ffffff12; }
.rate-sheet-panel h2 { margin: 0; font-size: 16px; font-weight: 600; color: #f4ece2; }
.rate-close { min-height: 0; min-width: 0; width: 32px; height: 32px; border: 0; border-radius: 999px; background: #ffffff14; color: #f4ece2; font-size: 20px; line-height: 1; cursor: pointer; }
.rate-sheet-body { overflow-y: auto; padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.rate-sheet-votes { display: flex; gap: 8px; }
.rate-sheet-votes { gap: 18px; }
.rate-vote-group { display: inline-flex; align-items: center; gap: 6px; }
.rate-sheet-votes .rate-btn { justify-content: center; padding: 6px 14px; font-size: 16px; }
.rate-count { min-height: 0; min-width: 0; padding: 2px; border: 0; background: none; color: #e8dfd2; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rate-count:hover { color: #f4ece2; }
.rate-count:disabled { text-decoration: none; color: #8f857a; cursor: default; }
/* The voters popup sits on top of the sheet as a small card */
.rate-who-popup .rate-sheet-panel { max-width: 380px; }
@media (max-width: 639px) { .rate-who-popup .rate-sheet-panel { max-height: 60vh; } }
.rate-sheet section h3 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #cbb89a; }
.rate-empty { margin: 0; font-size: 13px; color: #8f857a; }
.rate-people, .rate-comments { margin: 0; padding: 0; list-style: none; }
.rate-people { display: flex; flex-wrap: wrap; gap: 6px; }
.rate-people li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #ffffff0d; }
.rate-avatar { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 24px; height: 24px; overflow: hidden; border-radius: 999px; border: 1px solid #cbb89a4d; background: #2d2323; color: #cbb89a; font-size: 11px; font-weight: 600; }
.rate-sheet b { font-weight: 600; color: #f4ece2; font-size: 13px; }
.rate-comments li { padding: 8px 0; border-bottom: 1px solid #ffffff0d; }
.rate-comments li:last-child { border-bottom: 0; }
.rate-who { display: flex; align-items: center; gap: 6px; }
.rate-comments p { margin: 4px 0 0 30px; font-size: 13px; color: #d9cfc2; white-space: pre-line; overflow-wrap: anywhere; }
.rate-mine { display: flex; flex-direction: column; gap: 8px; }
.rate-mine textarea { min-height: 72px; padding: 8px 10px; border: 1px solid #ffffff1f; border-radius: 10px; background: #0e0b0b; color: #f0e8da; font: 16px/1.4 inherit; resize: vertical; }
.rate-save { align-self: flex-end; min-height: 0; min-width: 0; padding: 8px 16px; border: 0; border-radius: 999px; background: #b91c1c; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.rate-save:hover { background: #dc2626; }
@media (min-width: 640px) {
    .rate-sheet { align-items: center; }
    .rate-sheet-panel { max-width: 440px; border-bottom: 1px solid #cbb89a40; border-radius: 18px; }
}

.rate-edit { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0 30px; }
.rate-edit[hidden], .rate-body[hidden], .rate-comments p[hidden], .rate-comment-actions[hidden], .rate-reply-form[hidden] { display: none; }
/* The comment text with its Edit / Delete on the right of the same line */
.rate-comments .rate-body { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 0 30px; }
.rate-comments .rate-body p { flex: 1; min-width: 0; margin: 0; }
.rate-form-actions { display: flex; justify-content: flex-end; gap: 6px; }
.rate-form-actions .rate-save { padding: 5px 14px; }
.rate-form-actions [data-cancel] { min-height: 0; min-width: 0; padding: 5px 12px; border: 1px solid #ffffff1f; border-radius: 999px; background: transparent; color: #cbb89a; font-size: 13px; cursor: pointer; }
.rate-edit textarea { min-height: 56px; padding: 6px 8px; border: 1px solid #ffffff1f; border-radius: 8px; background: #0e0b0b; color: #f0e8da; font: 14px/1.4 inherit; resize: vertical; }
.rate-date { margin-left: auto; font-size: 11px; color: #8f857a; white-space: nowrap; }
.rate-person { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; }
.rate-person:hover b { color: #e3cf9f; text-decoration: underline; text-underline-offset: 2px; }
.rate-compact .rate-action { padding: 5px 10px; }
/* The comment a notification points at. */
.rate-comments li.rate-focus { margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: .6rem; background: rgba(232, 192, 106, .12); box-shadow: inset 3px 0 0 #e8c06a; }
/* Threads: Like and Reply under every comment, replies indented under their comment, and the reply box inline at the
   end of the thread, like Facebook and Instagram. */
.rate-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 4px 0 0 30px; }
.rate-comment-actions button { display: inline-flex; align-items: center; gap: 4px; min-height: 0; min-width: 0; padding: 0; border: 0; background: none; color: #a99e92; font-size: 12px; font-weight: 600; cursor: pointer; }
.rate-comment-actions button:hover { color: #f4ece2; }
.rate-comment-actions [data-act="delete"] { color: #d98c8c; }
.rate-comment-actions .rate-icon { width: 13px; height: 13px; }
.rate-like[aria-pressed="true"] { color: #e8c06a; }
.rate-replies { margin: 6px 0 0 30px; padding: 0 0 0 12px; list-style: none; border-left: 2px solid #ffffff14; }
.rate-comments .rate-replies li { padding: 6px 0; border-bottom: 0; }
.rate-reply-form { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px 42px; }
.rate-reply-form textarea { min-height: 40px; padding: 7px 12px; border: 1px solid #ffffff1f; border-radius: 16px; background: #0e0b0b; color: #f0e8da; font: 14px/1.4 inherit; resize: vertical; }

