/* Falue authoritative Post/Comment swipe-to-rate presentation. */
:root {
  --falue-rating-ink: #2b2d42;
  --falue-rating-muted: #707386;
  --falue-rating-accent: #5d5f93;
  --falue-rating-panel: rgba(255, 255, 255, .97);
  --falue-rating-soft: rgba(93, 95, 147, .10);
  --falue-rating-border: rgba(43, 45, 66, .14);
  --falue-rating-danger: #b54b56;
  --falue-rating-shadow: 0 14px 40px rgba(43, 45, 66, .22);
  --falue-negative-underlay: #565a68;
}

.falue-gesture-surface {
  touch-action: pan-y;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
}

[data-falue-rateable="post"].falue-gesture-surface.is-dragging {
  will-change: translate, rotate;
}

[data-falue-rateable="comment"].falue-gesture-surface.is-dragging {
  will-change: translate;
}

.falue-gesture-surface.is-dragging {
  z-index: 3;
  transition: none !important;
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

[data-falue-rateable="post"].falue-gesture-surface.is-snapping {
  transition:
    translate 280ms cubic-bezier(.2, .8, .2, 1),
    rotate 280ms cubic-bezier(.2, .8, .2, 1) !important;
}

[data-falue-rateable="comment"].falue-gesture-surface.is-snapping {
  transition: translate 250ms cubic-bezier(.2, .8, .2, 1) !important;
}

.falue-gesture-chrome {
  --falue-surface-radius: 18px;
  --falue-underlay-color: transparent;
  position: fixed;
  z-index: 2147483000;
  display: block;
  overflow: hidden;
  border-radius: var(--falue-surface-radius);
  background: var(--falue-underlay-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
  will-change: clip-path, background-color;
  transition: background-color 90ms linear;
}

.falue-gesture-chrome.is-active {
  opacity: 1;
  visibility: visible;
}

.falue-gesture-chrome__cue {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  width: min(170px, 46%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 120ms ease;
}

.falue-gesture-chrome__cue--negative {
  right: 0;
}

.falue-gesture-chrome__cue--rating {
  left: 0;
}

.falue-gesture-chrome__cue-icon,
.falue-gesture-chrome__cue-label,
.falue-gesture-chrome__cue-value {
  display: block;
}

.falue-gesture-chrome__cue-icon {
  max-width: 100%;
  font-size: 34px;
  line-height: 1.05;
  white-space: nowrap;
}

.falue-gesture-chrome__cue-label {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: .01em;
}

.falue-gesture-chrome__cue-value {
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .16);
}

.falue-gesture-chrome[data-surface="comment"] .falue-gesture-chrome__cue {
  width: min(132px, 48%);
  padding: 6px;
}

.falue-gesture-chrome[data-surface="comment"] .falue-gesture-chrome__cue-value {
  font-size: clamp(21px, 6vw, 30px);
}

.falue-gesture-chrome[data-surface="comment"] .falue-gesture-chrome__cue-label {
  margin-top: 2px;
  font-size: 10px;
}

.falue-rating-summary {
  position: relative;
  appearance: none;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.falue-rating-summary:hover,
.falue-rating-summary:focus-visible,
.falue-rating-summary.has-own-rating,
.falue-rating-summary.has-private-feedback {
  background: var(--falue-rating-soft);
  color: var(--falue-rating-accent);
}

.falue-rating-summary:focus-visible {
  border-color: rgba(93, 95, 147, .42);
  outline: 2px solid rgba(93, 95, 147, .22);
  outline-offset: 2px;
}

.falue-rating-summary.is-saving::after {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  opacity: .65;
  animation: falue-rating-spin 650ms linear infinite;
}

.falue-rating-summary.is-save-error {
  border-color: rgba(181, 75, 86, .55);
  background: rgba(181, 75, 86, .10);
  color: var(--falue-rating-danger);
}

@keyframes falue-rating-spin {
  to { transform: rotate(1turn); }
}

.falue-rating-picker {
  position: fixed;
  z-index: 2147483200;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 5px;
  width: min(calc(100vw - 16px), 382px);
  padding: 8px;
  border: 1px solid var(--falue-rating-border);
  border-radius: 18px;
  background: var(--falue-rating-panel);
  box-shadow: var(--falue-rating-shadow);
  color: var(--falue-rating-ink);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.falue-rating-picker__title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.falue-rating-picker__option,
.falue-rating-picker__negative {
  box-sizing: border-box;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.falue-rating-picker__option {
  display: flex;
  min-width: 0;
  min-height: 60px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 3px;
}

.falue-rating-picker__icon {
  max-width: 100%;
  overflow: hidden;
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
}

.falue-rating-picker__option small {
  margin-top: 5px;
  color: var(--falue-rating-muted);
  font-size: 10px;
  font-weight: 850;
}

.falue-rating-picker__option:hover,
.falue-rating-picker__option:focus-visible,
.falue-rating-picker__negative:hover,
.falue-rating-picker__negative:focus-visible,
.falue-rating-picker__option.is-selected,
.falue-rating-picker__negative.is-selected {
  border-color: rgba(93, 95, 147, .24);
  background: var(--falue-rating-soft);
  outline: none;
}

.falue-rating-picker__option:focus-visible,
.falue-rating-picker__negative:focus-visible {
  box-shadow: 0 0 0 2px rgba(93, 95, 147, .28);
}

.falue-rating-picker__option.is-selected,
.falue-rating-picker__negative.is-selected {
  color: var(--falue-rating-accent);
  box-shadow: inset 0 0 0 1px rgba(93, 95, 147, .20);
}

.falue-rating-picker__negative {
  grid-column: 1 / -1;
  min-height: 40px;
  border-top-color: var(--falue-rating-border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.falue-comment-muted > :not([data-falue-comment-feedback-notice]) {
  display: none !important;
}

.falue-comment-muted__notice {
  box-sizing: border-box;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--falue-rating-border);
  border-radius: 12px;
  background: rgba(181, 183, 187, .13);
  color: var(--falue-rating-muted);
  font-size: 12px;
  font-weight: 650;
}

.falue-comment-muted__notice button {
  appearance: none;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--falue-rating-accent);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.falue-comment-muted__notice button:hover,
.falue-comment-muted__notice button:focus-visible {
  background: var(--falue-rating-soft);
  outline: 2px solid rgba(93, 95, 147, .24);
}

.falue-comment-muted__notice button:disabled {
  cursor: wait;
  opacity: .55;
}

.falue-gesture-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483300;
  box-sizing: border-box;
  max-width: min(88vw, 430px);
  transform: translate(-50%, 18px);
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(43, 45, 66, .96);
  box-shadow: 0 10px 30px rgba(43, 45, 66, .25);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.falue-gesture-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.falue-gesture-live {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

body[data-theme="dark"] {
  --falue-rating-ink: #f1f2f6;
  --falue-rating-muted: #b5b7c5;
  --falue-rating-panel: rgba(31, 33, 43, .97);
  --falue-rating-soft: rgba(141, 144, 204, .16);
  --falue-rating-border: rgba(235, 236, 245, .18);
  --falue-rating-shadow: 0 14px 44px rgba(0, 0, 0, .48);
}

html.falue-rating-night-mode {
  --falue-rating-ink: #f1f2f6;
  --falue-rating-muted: #b5b7c5;
  --falue-rating-panel: rgba(31, 33, 43, .97);
  --falue-rating-soft: rgba(141, 144, 204, .16);
  --falue-rating-border: rgba(235, 236, 245, .18);
  --falue-rating-shadow: 0 14px 44px rgba(0, 0, 0, .48);
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --falue-rating-ink: #f1f2f6;
    --falue-rating-muted: #b5b7c5;
    --falue-rating-panel: rgba(31, 33, 43, .97);
    --falue-rating-soft: rgba(141, 144, 204, .16);
    --falue-rating-border: rgba(235, 236, 245, .18);
    --falue-rating-shadow: 0 14px 44px rgba(0, 0, 0, .48);
  }
}

@media (hover: hover) and (pointer: fine) {
  .falue-gesture-surface:not(.is-snapping) {
    cursor: grab;
  }

  .falue-gesture-surface :is(a, button, input, textarea, select, [onclick], [data-href], .pointer) {
    cursor: revert;
  }
}

@media (max-width: 560px) {
  .falue-rating-picker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100vw - 16px);
  }

  .falue-rating-picker__option {
    min-height: 56px;
    padding-inline: 1px;
  }

  .falue-rating-picker__icon {
    font-size: 15px;
  }

  .falue-gesture-chrome__cue-icon {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-falue-rateable="post"].falue-gesture-surface.is-snapping,
  [data-falue-rateable="comment"].falue-gesture-surface.is-snapping,
  .falue-gesture-chrome__cue,
  .falue-gesture-toast,
  .falue-rating-summary {
    transition-duration: 1ms !important;
  }

  .falue-rating-summary.is-saving::after {
    animation-duration: 1.5s;
  }
}
