.scfr-rating-panel {
  --scfr-brand: var(--brand, #1768e8);
  --scfr-brand-dark: var(--brand-dark, #0a47af);
  --scfr-gold: #ffb300;
  box-sizing: border-box;
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  overflow: hidden;
  direction: rtl;
  color: #26384d;
  border: 1px solid rgba(23, 104, 232, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(121, 200, 255, 0.18), transparent 42%),
    linear-gradient(145deg, #f8fbff, #fff);
  font-family: inherit;
}

.scfr-rating-panel,
.scfr-rating-panel * {
  box-sizing: border-box;
}

.scfr-rating-panel button {
  font: inherit;
}

.scfr-rating-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--scfr-brand), #ffbb27, transparent);
}

.scfr-rating-anchor {
  width: 100%;
  max-width: 540px;
}

.scfr-rating-head {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scfr-rating-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #263a54;
  font-size: 10px;
  font-weight: 950;
}

.scfr-rating-title svg {
  width: 14px;
  height: 14px;
  fill: var(--scfr-gold);
}

.scfr-rating-state {
  min-height: 20px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #778393;
  background: #eef3f8;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.scfr-rating-panel.scfr-ready .scfr-rating-state {
  color: #14734a;
  background: #e7f8ef;
}

.scfr-rating-panel.scfr-guest .scfr-rating-state {
  color: #8a6814;
  background: #fff6d9;
}

.scfr-rating-panel.scfr-unavailable .scfr-rating-state {
  color: #9c2f2f;
  background: #fff0f0;
}

.scfr-rating-row {
  --scfr-track: #1768e8;
  min-height: 42px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 72px minmax(104px, 1fr) 60px;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.scfr-rating-row + .scfr-rating-row {
  margin-top: 3px;
  border-top: 1px dashed #e5ebf1;
}

.scfr-rating-row:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(-1px);
}

.scfr-rating-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #354254;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
}

.scfr-rating-label i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--scfr-track);
  box-shadow: 0 0 0 3px rgba(23, 104, 232, 0.09);
}

.scfr-star-control {
  direction: rtl;
  min-width: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.scfr-star-unit {
  --scfr-fill: 0%;
  position: relative !important;
  width: 20px !important;
  height: 24px !important;
  min-width: 20px !important;
  min-height: 24px !important;
  flex: 0 0 20px !important;
  display: block !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}

.scfr-star-visual {
  position: absolute !important;
  inset: 0;
  display: grid !important;
  place-items: center;
  color: transparent !important;
  background: linear-gradient(
    to left,
    var(--scfr-gold) 0,
    var(--scfr-gold) var(--scfr-fill),
    #dce3ea var(--scfr-fill),
    #dce3ea 100%
  );
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-family: Arial, "Segoe UI Symbol", sans-serif !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  filter: drop-shadow(0 2px 3px rgba(255, 179, 0, 0.1));
  pointer-events: none;
}

.scfr-star-unit::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 1px;
  opacity: 0.38;
  background: #fff;
  pointer-events: none;
}

.scfr-rating-panel button.scfr-star-half {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: absolute !important;
  z-index: 3 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 50% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  border: 0 !important;
  border-radius: 0 !important;
  outline-offset: 0;
  color: transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
  line-height: 0 !important;
  font-size: 0 !important;
  opacity: 1 !important;
}

.scfr-rating-panel button.scfr-star-half.scfr-half-start {
  right: 0 !important;
  left: auto !important;
}

.scfr-rating-panel button.scfr-star-half.scfr-half-end {
  left: 0 !important;
  right: auto !important;
}

.scfr-rating-panel button.scfr-star-half:hover,
.scfr-rating-panel button.scfr-star-half:focus,
.scfr-rating-panel button.scfr-star-half:active {
  color: transparent !important;
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.scfr-rating-panel button.scfr-star-half:focus-visible {
  outline: 2px solid var(--scfr-track);
  outline-offset: -2px;
  border-radius: 6px;
}

.scfr-rating-panel button.scfr-star-half:disabled {
  cursor: not-allowed;
}

.scfr-rating-panel.scfr-submitting .scfr-star-control {
  opacity: 0.52;
  pointer-events: none;
}

.scfr-rating-stat {
  min-width: 0;
  direction: rtl;
  text-align: left;
}

.scfr-rating-stat strong {
  display: block;
  color: #26384d;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.scfr-rating-stat span {
  display: block;
  overflow: hidden;
  color: #98a2ae;
  font-size: 7px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scfr-rating-foot {
  margin-top: 6px;
  padding-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #edf1f5;
  color: #8a95a2;
  font-size: 8px;
  font-weight: 750;
}

.scfr-rating-login {
  appearance: none;
  padding: 4px 8px;
  cursor: pointer;
  border: 1px solid rgba(23, 104, 232, 0.12);
  border-radius: 8px;
  color: var(--scfr-brand-dark);
  background: #edf5ff;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease;
}

.scfr-rating-login:hover {
  transform: translateY(-1px);
  background: #dfeeff;
}

.scfr-rating-panel:not(.scfr-guest) .scfr-rating-login {
  display: none;
}

.scfr-rating-skeleton {
  display: inline-block !important;
  width: 32px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9eef4, #f8fafc, #e9eef4);
  background-size: 200% 100%;
  animation: scfr-shimmer 1.1s linear infinite;
}

.scfr-toast {
  position: fixed;
  z-index: 999999;
  left: 22px;
  bottom: 22px;
  width: min(390px, calc(100vw - 24px));
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  border: 1px solid rgba(23, 104, 232, 0.16);
  border-radius: 15px;
  color: #26384d;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 50px rgba(31, 56, 91, 0.2);
  backdrop-filter: blur(14px);
  direction: rtl;
  font-family: inherit;
  transition: 0.25s ease;
}

.scfr-toast.scfr-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scfr-toast-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #1768e8, #2a84ff);
}

.scfr-toast-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
}

.scfr-toast strong,
.scfr-toast small {
  display: block;
}

.scfr-toast strong {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 950;
}

.scfr-toast small {
  color: #7d8794;
  font-size: 9px;
  line-height: 1.8;
}

.scfr-shortcode-error {
  color: #b42318;
}

@keyframes scfr-shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 420px) {
  .scfr-rating-panel {
    padding: 9px 8px;
  }

  .scfr-rating-row {
    grid-template-columns: 64px minmax(94px, 1fr) 54px;
    gap: 3px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .scfr-star-control {
    min-width: 94px;
  }

  .scfr-star-unit {
    width: 18px;
    flex-basis: 18px;
  }

  .scfr-star-visual {
    font-size: 18px;
  }

  .scfr-rating-label,
  .scfr-rating-state,
  .scfr-rating-foot {
    font-size: 7px;
  }

  .scfr-toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scfr-rating-panel *,
  .scfr-toast {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
