* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: transparent;
  color: #1f2937;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.widget {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 0;
  background: #f3f5f8;
  border-radius: 16px;
  border: 1px solid #d8dee8;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
  padding: 14px;
}

.widget__header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  margin: -14px -14px 12px;
  padding: 14px 14px 12px;
  background: #ffffff;
  border-bottom: 1px solid #d7dee8;
  border-radius: 16px 16px 12px 12px;
  box-shadow: 0 2px 0 rgba(148, 163, 184, 0.18);
}

.widget__label {
  margin: 0 0 4px;
  color: #6b7280;
  font-size: 13px;
}

.widget__title {
  margin: 0;
  font-size: 28px;
}

.widget__meta {
  margin: 10px 0 0;
  color: #374151;
}

.widget__meta--highlight {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e8f1e8;
  color: #4f6b4d;
  font-weight: 700;
}

.widget__button {
  text-decoration: none;
  background: #229ed9;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.widget__button--bottom {
  display: inline-flex;
  margin-top: 12px;
}

.widget__powered {
  margin-top: 10px;
  color: #6b7280;
  font-size: 13px;
}

.widget__powered a {
  color: #4f6b4d;
  text-decoration: none;
  font-weight: 600;
}

.widget__posts {
  height: 470px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  margin-top: 2px;
  border-top: 1px solid #dbe3ee;
}

.widget__posts--bottom {
  justify-content: flex-end;
}

.widget--full .widget__posts {
  height: auto;
  overflow: visible;
  scroll-snap-type: none;
}

.widget--full .post {
  scroll-snap-align: none;
}

.post {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fcfcfd;
  scroll-snap-align: start;
  overflow: hidden;
  height: auto;
  margin: 0 0 12px;
  width: 100%;
  max-width: 100%;
  display: block;
  break-inside: auto;
  flex: 0 0 auto;
}

.post__media {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  background: #e5e7eb;
}

.post__media img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
  background: #f3f4f6;
}

.post__media-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
}

.post__text {
  margin: 0 0 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post__text a {
  color: #4f6b4d;
}

.post__text pre {
  overflow-x: auto;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px;
}

.post__text blockquote {
  margin: 8px 0;
  padding-left: 10px;
  border-left: 3px solid #d1d5db;
  color: #4b5563;
}

.post__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #4b5563;
  font-size: 14px;
}

.post__stats {
  display: flex;
  gap: 10px;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

.stat svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.8;
}

.post__link {
  color: #4f6b4d;
  text-decoration: none;
  font-weight: 500;
}

.post__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.post__date {
  color: #6b7280;
  font-size: 12px;
  text-transform: lowercase;
}

.error {
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 10px;
  padding: 12px;
}

@media (max-width: 800px) {
  body {
    padding: 4px;
  }

  .widget {
    padding: 12px;
  }

  .widget__header {
    margin: -12px -12px 10px;
    padding: 12px 12px 10px;
    border-radius: 16px 16px 10px 10px;
  }

  .widget__posts {
    height: 420px;
    padding: 6px 0;
  }

  .widget__header {
    flex-direction: column;
    align-items: stretch;
  }

  .widget__button--bottom {
    width: 100%;
    justify-content: center;
  }
}


