.mrating-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000003;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.mrating-overlay.mrating-overlay-hide {
  opacity: 0;
}

.mrating-modal {
  width: 60%;
  height: min(92vh, 980px);
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}

.mrating-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ff8a00;
  padding: 10px 12px;
}

.mrating-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
}

.mrating-close-btn {
  border: 1px solid #9e9e9e;
  color: #666;
  border-radius: 12px;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
}

.mrating-close-btn:hover,
.mrating-close-btn:focus-visible {
  border-color: #d92d20;
  color: #d92d20;
  outline: none;
}

.mrating-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-bottom: 1px solid #f3e3cb;
}

.mrating-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border: none;
  border-bottom: 2px solid transparent;
  color: #111;
  padding: 10px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.mrating-tab-btn.active {
  background: rgba(255, 138, 0, 0.4);
  border-bottom-color: #ff8a00;
  color: #ff8a00;
  border-radius: 0;
}

.mrating-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.mrating-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding-bottom: 72px;
}

.mrating-card {
  width: 100%;
  border: 1px solid #f1e6d7;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.mrating-stats-row {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.mrating-chart-card {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #f1e6d7;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.mrating-chart-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}

.mrating-donut-wrap {
  position: relative;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}

.mrating-donut {
  width: 100%;
  height: auto;
}

.mrating-donut-seg {
  cursor: pointer;
  transition: opacity 0.18s ease, filter 0.18s ease, stroke-width 0.18s ease;
}

.mrating-donut-seg:hover,
.mrating-donut-seg.is-hover {
  filter: brightness(1.06);
  stroke-width: 20;
}

.mrating-donut-seg.is-selected {
  filter: brightness(1.12);
  stroke-width: 22;
}

.mrating-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.mrating-donut-center strong {
  font-size: 1rem;
  color: #1f1f1f;
}

.mrating-donut-center span {
  font-size: 0.72rem;
  color: #6f6f6f;
}

.mrating-donut-legend {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mrating-donut-legend-item {
  border: 1px solid #efe3d2;
  background: #fff;
  border-radius: 10px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  cursor: pointer;
}

.mrating-donut-legend-item:hover,
.mrating-donut-legend-item:focus-visible {
  border-color: #ffb800;
  outline: none;
}

.mrating-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-rating { background: #ff8a00; }
.dot-like { background: #2fb46f; }
.dot-share { background: #4b6bff; }
.dot-dislike { background: #d92d20; }

.mrating-area {
  width: 100%;
  height: auto;
}

.mrating-area-layer {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mrating-area-layer.layer-rating { fill: rgba(255, 138, 0, 0.55); }
.mrating-area-layer.layer-like { fill: rgba(47, 180, 111, 0.44); }
.mrating-area-layer.layer-share { fill: rgba(75, 107, 255, 0.40); }
.mrating-area-layer.layer-dislike { fill: rgba(217, 45, 32, 0.34); }

.mrating-area-layer.is-muted {
  opacity: 0.15;
}

.mrating-area-hit {
  fill: transparent;
  cursor: pointer;
}

.mrating-area-hit.is-hover,
.mrating-area-hit.is-selected {
  fill: rgba(255, 184, 0, 0.08);
}

.mrating-axis-x {
  fill: #666;
  font-size: 10px;
}

.mrating-area-legend {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mrating-area-legend button {
  border: 1px solid #efe3d2;
  background: #fff;
  border-radius: 9px;
  padding: 3px 6px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.mrating-area-legend button:hover,
.mrating-area-legend button:focus-visible {
  border-color: #ffb800;
  outline: none;
}

.mrating-chart-tip {
  position: fixed;
  z-index: 1000005;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  background: #111;
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: nowrap;
}

.mrating-chart-tip.is-on {
  opacity: 1;
  transform: translateY(0);
}

.mrating-note-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mrating-note {
  font-size: 2rem;
  font-weight: 800;
  color: #ff8a00;
}

.mrating-note span {
  font-size: 0.75rem;
  color: #8e8e8e;
}

.mrating-stars {
  display: inline-flex;
  gap: 2px;
}

.mrating-star { color: #d0d0d0; }
.mrating-star-on { color: #ffb800; }

.mrating-meta {
  font-size: 0.76rem;
  color: #7d7d7d;
}

.mrating-dist {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mrating-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mrating-row-score {
  width: 24px;
  font-size: 0.76rem;
  color: #555;
}

.mrating-row-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #efefef;
  overflow: hidden;
}

.mrating-row-fill {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb800, #ff8a00);
  animation: mratingGrow 0.7s ease;
}

.mrating-row-count {
  width: 52px;
  text-align: right;
  font-size: 0.74rem;
  color: #666;
}

.mrating-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mrating-stat-item {
  border: 1px solid #f4ead9;
  border-radius: 12px;
  padding: 8px;
  background: #fffefb;
}

.mrating-stat-title {
  font-size: 0.72rem;
  color: #606060;
}

.mrating-progress {
  margin-top: 6px;
  height: 8px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
}

.mrating-progress span {
  display: block;
  width: var(--pct, 0%);
  height: 100%;
  background: linear-gradient(90deg, #ffb800, #ff8a00);
  animation: mratingGrow 0.7s ease;
}

.mrating-pulse {
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ff8a00;
  animation: mratingPulse 1.2s ease-in-out infinite;
}

.mrating-stat-val {
  margin-top: 4px;
  font-size: 0.74rem;
  color: #676767;
}

.mrating-empty {
  width: 100%;
  text-align: center;
  color: #888;
  font-size: 0.8rem;
  padding: 12px;
}

.mrating-review-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mrating-review-card {
  border: 1px solid #efe7db;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.mrating-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mrating-review-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mrating-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.mrating-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mrating-avatar-initial {
  width: 100%;
  height: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.mrating-review-name {
  font-size: 0.82rem;
  color: #111;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.mrating-review-date {
  font-size: 0.7rem;
  color: #999;
}

.mrating-review-stars {
  margin-top: 4px;
  display: inline-flex;
  gap: 2px;
}

.mrating-review-text {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #1b1b1b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mrating-review-media {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.mrating-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mrating-action-btn {
  border: 1px solid #efe3d2;
  background: #fff;
  border-radius: 999px;
  min-height: 28px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #3a3a3a;
  cursor: pointer;
}

.mrating-action-btn:hover,
.mrating-action-btn:focus-visible {
  border-color: #ffb800;
  outline: none;
}

.mrating-action-btn.active {
  border-color: #ff8a00;
  background: #fff5e6;
  color: #c95d00;
}

.mrating-media-btn {
  width: 56px;
  height: 56px;
  border: 1px solid #ffe0b2;
  border-radius: 10px;
  padding: 2px;
  background: #fff8ee;
  cursor: pointer;
  flex: 0 0 56px;
}

.mrating-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.mrating-bottom-input {
  position: sticky;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, #fff 65%, rgba(255,255,255,0));
  padding-top: 8px;
}

.mrating-input-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
}

.mrating-input-star {
  border: none;
  background: transparent;
  color: #c8c8c8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

.mrating-input-star.active {
  color: #ffb800;
}

.mrating-input-row {
  width: 100%;
}

.mrating-input-error {
  margin-top: 5px;
  font-size: 0.72rem;
  color: #d92d20;
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mrating-input-error.is-visible {
  opacity: 1;
}

.mrating-inline-media-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 6px;
}

.mrating-inline-media-item {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.mrating-inline-media-open {
  width: 100%;
  height: 100%;
  border: 1px solid #ffe0b2;
  border-radius: 10px;
  background: #fff8ee;
  padding: 2px;
  cursor: pointer;
}

.mrating-inline-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.mrating-inline-media-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  background: #d92d20;
  color: #fff;
  font-size: 0.62rem;
  cursor: pointer;
}

.mrating-float-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1000008;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.76rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mrating-float-toast.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

@keyframes mratingGrow {
  from { width: 0; }
  to { width: var(--pct, 0%); }
}

@keyframes mratingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

@media (max-width: 768px) {
  .mrating-modal {
    width: 100%;
    height: 95vh;
  }

  .mrating-stats-row {
    flex-direction: column;
  }

  .mrating-donut-legend {
    grid-template-columns: 1fr;
  }
}
