.dgrw-widget {
  --dgrw-bg: #ffffff;
  --dgrw-card: #ffffff;
  --dgrw-text: #121826;
  --dgrw-muted: #667085;
  --dgrw-border: rgba(15, 23, 42, 0.08);
  --dgrw-accent: #0b57d0;
  --dgrw-star: #fbbc04;
  --dgrw-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --dgrw-radius: 20px;
  color: var(--dgrw-text);
  width: 100%;
}

.dgrw-theme-dark {
  --dgrw-bg: #0f172a;
  --dgrw-card: #111827;
  --dgrw-text: #f8fafc;
  --dgrw-muted: #cbd5e1;
  --dgrw-border: rgba(255, 255, 255, 0.08);
  --dgrw-accent: #60a5fa;
  --dgrw-shadow: 0 16px 44px rgba(2, 6, 23, 0.45);
}

.dgrw-widget * {
  box-sizing: border-box;
}

.dgrw-top {
  display: grid;
  grid-template-columns: 1.4fr minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.dgrw-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2vw, 2.35rem);
  line-height: 1.15;
  color: var(--dgrw-text);
}

.dgrw-subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--dgrw-muted);
  max-width: 62ch;
}

.dgrw-summary-card,
.dgrw-card {
  background: var(--dgrw-card);
  border: 1px solid var(--dgrw-border);
  border-radius: var(--dgrw-radius);
  box-shadow: var(--dgrw-shadow);
}

.dgrw-summary-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.dgrw-summary-label {
  font-size: .95rem;
  font-weight: 700;
  color: var(--dgrw-muted);
  letter-spacing: .02em;
}

.dgrw-summary-score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dgrw-summary-score {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--dgrw-text);
}

.dgrw-summary-meta {
  color: var(--dgrw-muted);
  font-size: .95rem;
}

.dgrw-summary-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dgrw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  background: var(--dgrw-accent);
  color: #fff !important;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 700;
  transition: transform .2s ease, opacity .2s ease;
}

.dgrw-button:hover {
  transform: translateY(-1px);
  opacity: .94;
}

.dgrw-button-secondary {
  background: transparent;
  color: var(--dgrw-text) !important;
  border: 1px solid var(--dgrw-border);
}

.dgrw-track {
  display: grid;
  grid-template-columns: repeat(var(--dgrw-columns), minmax(0, 1fr));
  gap: 22px;
}

.dgrw-card {
  padding: 22px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dgrw-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dgrw-author-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dgrw-author-photo-wrap {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.dgrw-author-photo,
.dgrw-author-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: rgba(11, 87, 208, .12);
  color: var(--dgrw-accent);
  font-weight: 700;
  font-size: 1rem;
}

.dgrw-author-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dgrw-author-name {
  font-weight: 800;
  color: var(--dgrw-text);
  text-decoration: none;
  line-height: 1.2;
  word-break: break-word;
}

.dgrw-author-name:hover {
  text-decoration: underline;
}

.dgrw-time {
  color: var(--dgrw-muted);
  margin-top: 4px;
  font-size: .92rem;
}

.dgrw-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.dgrw-star {
  font-size: 1rem;
  line-height: 1;
}

.dgrw-star.is-full,
.dgrw-star.is-half {
  color: var(--dgrw-star);
}

.dgrw-star.is-empty {
  color: rgba(148, 163, 184, 0.55);
}

.dgrw-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dgrw-text {
  color: var(--dgrw-text);
  line-height: 1.75;
  font-size: 1rem;
  white-space: pre-line;
}

.dgrw-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dgrw-more {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--dgrw-accent);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.dgrw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--dgrw-muted);
  font-size: .9rem;
}

.dgrw-google-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.dgrw-google-badge::before {
  content: "G";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
}

.dgrw-attributions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dgrw-error {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #ef4444;
  color: #991b1b;
  background: #fef2f2;
}

@media (max-width: 980px) {
  .dgrw-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .dgrw-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .dgrw-track::-webkit-scrollbar {
    height: 8px;
  }

  .dgrw-track::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
  }

  .dgrw-card {
    flex: 0 0 86%;
    scroll-snap-align: start;
  }

  .dgrw-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .dgrw-summary-actions,
  .dgrw-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dgrw-button {
    width: 100%;
  }
}
