.rrwp-app {
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 920px;
  margin: 12px auto;
  padding: 0 12px;
  color: #0f172a;
  line-height: 1.5;
  position: relative;
}

.rrwp-app-feed {
  max-width: 440px;
}

.rrwp-app-upload {
  max-width: 560px;
}

.rrwp-app *, .rrwp-app *::before, .rrwp-app *::after {
  box-sizing: border-box;
}

.rrwp-loading {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  padding: 40px 24px;
  text-align: center;
  font-size: 14px;
}

.rrwp-card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
}

.rrwp-grid-wallet {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 780px) {
  .rrwp-grid-wallet {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}

/* Modern Centered 9:16 Reels Stage */
.rrwp-stage-wrap {
  position: relative;
  width: 100%;
  max-width: 416px;
  margin: 0 auto;
}

.rrwp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 82vh;
  background: #070a12;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  user-select: none;
}

.rrwp-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.rrwp-top-scrim {
  position: absolute;
  inset: 0 0 auto 0;
  height: 88px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
  pointer-events: none;
  z-index: 4;
}

.rrwp-top-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 12;
  pointer-events: none;
}

.rrwp-duration-text {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  font-variant-numeric: tabular-nums;
}

.rrwp-icon-pill {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.rrwp-icon-pill:hover {
  background: rgba(15, 23, 42, 0.78);
  transform: scale(1.06);
}

.rrwp-pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 6;
}

.rrwp-pause-circle {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

/* Right Action Rail INSIDE Video */
.rrwp-actions-rail {
  position: absolute;
  right: 12px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 12;
}

.rrwp-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rrwp-rail-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.rrwp-rail-btn:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: scale(1.06);
}

.rrwp-rail-btn.is-following {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(6, 95, 70, 0.55);
}

.rrwp-follow-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

.rrwp-follow-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1.5px solid #0f172a;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rrwp-rail-btn.is-following .rrwp-follow-badge {
  background: #334155;
}

.rrwp-rail-btn.is-liked {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(136, 19, 55, 0.45);
}

.rrwp-rail-tip {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid rgba(167, 243, 208, 0.75);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.42);
}

.rrwp-rail-tip:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.rrwp-rail-label {
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  font-variant-numeric: tabular-nums;
}

/* Bottom Meta Overlay */
.rrwp-overlay-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 72px 20px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.48) 58%, transparent 100%);
  color: #ffffff;
  z-index: 8;
  pointer-events: none;
}

.rrwp-creator-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.rrwp-video-title {
  margin: 5px 0 3px 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.rrwp-video-caption {
  margin: 0;
  font-size: 12px;
  color: rgba(241, 245, 249, 0.84);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rrwp-tip-summary {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
  font-variant-numeric: tabular-nums;
}

/* Progress Track */
.rrwp-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 15;
}

.rrwp-progress-fill {
  height: 100%;
  width: 0%;
  background: #34d399;
  transition: width 0.2s linear;
}

.rrwp-stage {
  touch-action: pan-x;
}

/* Slide-up Comment Sheet INSIDE Video Stage */
.rrwp-comment-sheet {
  position: absolute;
  inset: auto 0 0 0;
  height: 68%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f8fafc;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 25;
}

.rrwp-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rrwp-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.rrwp-cmt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rrwp-cmt-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.rrwp-sheet-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.7);
}

.rrwp-sheet-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  color: #ffffff !important;
}

/* Floating Toast inside Widget */
.rrwp-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.rrwp-toast-ok {
  background: #065f46;
  color: #ecfdf5;
  border: 1px solid #34d399;
}

.rrwp-toast-err {
  background: #991b1b;
  color: #fef2f2;
  border: 1px solid #f87171;
}

/* Form Elements for Upload & Wallet */
.rrwp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rrwp-tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.rrwp-tab-btn.is-active {
  background: #0f172a;
  color: #ffffff;
}

.rrwp-field {
  margin-bottom: 14px;
}

.rrwp-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.rrwp-input, .rrwp-select, .rrwp-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px;
}

.rrwp-btn-primary {
  appearance: none;
  border: none;
  background: #059669;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.rrwp-btn-primary:hover {
  background: #047857;
}

.rrwp-btn-dark {
  appearance: none;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.rrwp-btn-outline {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.rrwp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
}

.rrwp-modal-box {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.45);
}

.rrwp-tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
