/* Result share modal + card export styles */
.rshare-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 2px solid #d55d34;
  background: #fff;
  color: #d55d34 !important;
  text-decoration: none;
  transition: all .15s;
}
.rshare-open-btn:hover {
  background: #fff5f0;
  border-color: #b04a2a;
  color: #b04a2a !important;
  transform: translateY(-1px);
}
.rshare-open-btn i { font-size: 0.95em; }

.rshare-overlay {
  position: fixed; inset: 0; background: rgba(20,12,8,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 10050; padding: 16px;
}
.rshare-overlay.open { display: flex; }

.rshare-modal {
  width: min(820px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(20,12,8,0.28);
  overflow: hidden;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #1a1410;
}
.rshare-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e8ddd4;
}
.rshare-head h2 {
  font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
  font-size: 1.1rem; font-weight: 800; margin: 0;
}
.rshare-close {
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: #f3ebe3; font-size: 1.15rem; cursor: pointer; color: #1a1410; line-height: 1;
}

.rshare-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}
.rshare-preview-pane {
  background: #2a211c;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 18px;
}
.rshare-preview-scale {
  width: 189px; height: 336px;
  overflow: hidden; position: relative;
}
.rshare-preview-scale[data-plat="square"] { width: 210px; height: 210px; }
.rshare-preview-scale[data-plat="wide"] { width: 240px; height: 126px; }
.rshare-preview-scale .rshare-preview {
  transform: scale(0.7);
  transform-origin: top left;
  width: 270px;
}
.rshare-preview-scale[data-plat="square"] .rshare-preview { transform: scale(0.7); width: 300px; }
.rshare-preview-scale[data-plat="wide"] .rshare-preview { transform: scale(0.6); width: 400px; }

.rshare-controls {
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.rshare-field label {
  display: block; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: #6b5c52;
  margin-bottom: 8px;
}
.rshare-swatches { display: flex; gap: 10px; }
.rshare-swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0;
}
.rshare-swatch.active { border-color: #1a1410; box-shadow: 0 0 0 2px #fff inset; }
.rshare-swatch[data-style="warm"] { background: linear-gradient(145deg, #e06a3a, #a33a18); }
.rshare-swatch[data-style="dark"] { background: linear-gradient(145deg, #2c1a12, #17110e); }
.rshare-swatch[data-style="paper"] { background: linear-gradient(145deg, #fffaf5, #e8c4a8); border: 2px solid #e0d0c2; }
.rshare-swatch[data-style="paper"].active { border-color: #1a1410; }
.rshare-swatch-lbl {
  display: flex; gap: 10px; margin-top: 6px;
  font-size: 0.7rem; font-weight: 600; color: #6b5c52;
}
.rshare-swatch-lbl span { width: 36px; text-align: center; }

.rshare-seg {
  display: flex; background: #f3ebe3; border-radius: 10px; padding: 3px; gap: 2px;
}
.rshare-seg button {
  flex: 1; border: 0; background: transparent; border-radius: 8px;
  padding: 8px 6px; font: inherit; font-size: 0.78rem; font-weight: 700;
  color: #6b5c52; cursor: pointer;
}
.rshare-seg button.active { background: #fff; color: #1a1410; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.rshare-caption-row { display: flex; gap: 8px; align-items: stretch; }
.rshare-caption-box {
  flex: 1; background: #faf6f2; border: 1px solid #e8ddd4; border-radius: 10px;
  padding: 11px 12px; font-size: 0.86rem; line-height: 1.45; color: #1a1410;
  min-height: 4.8em; max-height: 7.2em; overflow: auto;
}
.rshare-btn {
  border: 0; border-radius: 999px; padding: 12px 20px;
  font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.rshare-btn-primary { background: #d55d34; color: #fff; }
.rshare-btn-primary:hover { background: #c04d24; }
.rshare-btn-primary:disabled { opacity: 0.65; cursor: wait; }
.rshare-btn-ghost {
  background: #fff; color: #1a1410; border: 1.5px solid #e8ddd4;
}
.rshare-btn-ghost:hover { border-color: #d55d34; color: #d55d34; }
.rshare-caption-row .rshare-btn {
  flex-shrink: 0; padding: 8px 12px; font-size: 0.78rem; border-radius: 10px;
}
.rshare-actions { display: flex; gap: 8px; margin-top: auto; }
.rshare-actions .rshare-btn { flex: 1; padding: 11px 12px; font-size: 0.86rem; }

.rshare-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #1a1410; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 700; opacity: 0; pointer-events: none;
  transition: .2s ease; z-index: 10060;
}
.rshare-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Share card */
.rshare-sc {
  position: relative; overflow: hidden;
  font-family: "Bricolage Grotesque", "DM Sans", sans-serif; color: #fff;
  box-shadow: 0 14px 32px rgba(40,20,10,0.2);
  display: flex; flex-direction: column;
}
.rshare-sc.story { width: 270px; height: 480px; border-radius: 18px; padding: 16px; }
.rshare-sc.square { width: 300px; height: 300px; border-radius: 16px; padding: 16px; }
.rshare-sc.wide { width: 400px; height: 210px; border-radius: 14px; padding: 16px; }
.rshare-sc .bg { position: absolute; inset: 0; }
.rshare-sc .fg { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }
.rshare-sc.t-warm .bg { background: linear-gradient(165deg, #e06a3a 0%, #a33a18 100%); }
.rshare-sc.t-dark .bg {
  background:
    radial-gradient(90% 60% at 85% 10%, rgba(213,93,52,0.45) 0%, transparent 55%),
    linear-gradient(165deg, #17110e 0%, #2c1a12 100%);
}
.rshare-sc.t-paper { color: #1a1410; }
.rshare-sc.t-paper .bg { background: linear-gradient(180deg, #fffaf5 0%, #f5dfcc 100%); }

.rshare-sc .logo {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; padding: 4px 8px 4px 4px;
}
.rshare-sc.t-paper .logo { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.06); }
.rshare-sc .logo img { width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.rshare-sc .logo span { font-family: "DM Sans", sans-serif; font-size: 0.62rem; font-weight: 700; }
.rshare-sc .hook {
  margin-top: 10px; font-size: 1rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; max-width: 16ch;
}
.rshare-sc .cat {
  margin-top: 10px; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
}
.rshare-sc .ring {
  position: relative; width: 110px; height: 110px; margin: 10px 0 0;
}
.rshare-sc .ring svg { width: 100%; height: 100%; display: block; }
.rshare-sc .ring .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.rshare-sc .ring .n { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.rshare-sc .ring .u {
  font-family: "DM Sans", sans-serif; font-size: 0.55rem; font-weight: 700; opacity: 0.85;
}
.rshare-sc .tier {
  display: inline-flex; align-self: flex-start; margin-top: 8px;
  padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,0.18);
  font-size: 0.75rem; font-weight: 800;
}
.rshare-sc.t-paper .tier { background: #fff3e9; color: #9e3a1c; }
.rshare-sc .subs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: auto; width: 100%;
}
.rshare-sc .subs .c {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 6px 7px;
}
.rshare-sc.t-paper .subs .c { background: #fff; border-color: #f0d8c8; }
.rshare-sc .subs .k {
  font-family: "DM Sans", sans-serif; font-size: 0.52rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.75;
}
.rshare-sc .subs .v { font-size: 0.95rem; font-weight: 800; line-height: 1.1; margin-top: 1px; }
.rshare-sc.t-paper .subs .v { color: #d55d34; }
.rshare-sc .hz {
  font-size: 3.4rem; font-weight: 800; letter-spacing: -0.06em; line-height: 0.9; margin-top: 12px;
}
.rshare-sc .hz-lbl {
  font-family: "DM Sans", sans-serif; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-top: 4px;
}
.rshare-sc .art {
  position: absolute; right: -24px; bottom: 70px; width: 130px; height: 130px;
  object-fit: contain; opacity: 0.7; pointer-events: none; z-index: 1;
}
.rshare-sc .art-inline {
  width: 96px; height: 96px; object-fit: contain; flex-shrink: 0;
  opacity: 0.95; pointer-events: none;
}
.rshare-sc .hook-wide { max-width: 22ch; }
.rshare-sc .big {
  font-size: 3.2rem; font-weight: 800; letter-spacing: -0.06em; line-height: 0.95;
}
.rshare-sc .big-unit {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0; opacity: 0.85;
}
.rshare-sc .name {
  font-family: "DM Sans", sans-serif; font-size: 0.78rem; font-weight: 700;
  opacity: 0.85; margin-top: 2px;
}
.rshare-sc .subline {
  font-family: "DM Sans", sans-serif; font-size: 0.82rem; font-weight: 700;
  margin-top: 4px; opacity: 0.95;
}
.rshare-sc .sq-row {
  display: flex; align-items: center; gap: 12px; margin-top: 8px;
}
.rshare-sc .tw-row {
  display: flex; align-items: center; gap: 12px; margin-top: 6px; min-height: 0; flex: 1;
}
.rshare-sc .tw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rshare-sc .subs.three { grid-template-columns: repeat(3, 1fr); }

/* Square — feed 1:1 (matches viral-share-cards mockup) */
.rshare-sc.square { padding: 14px; }
.rshare-sc.square .hook { font-size: 0.92rem; margin-top: 8px; line-height: 1.15; }
.rshare-sc.square .cat { font-size: 1.35rem; margin-top: 6px; }
.rshare-sc.square .big { font-size: 2.9rem; margin-top: 0; }
.rshare-sc.square .name { font-size: 0.72rem; }
.rshare-sc.square .subline { font-size: 0.78rem; }
.rshare-sc.square .hz-lbl { margin-top: 2px; }
.rshare-sc.square .subs { margin-top: auto; }
.rshare-sc.square .subs .c { padding: 5px 6px; }
.rshare-sc.square .subs .v { font-size: 0.88rem; }
.rshare-sc.square .art-inline { width: 88px; height: 88px; border-radius: 16px; }

/* Wide — link / OG card (matches viral-share-cards mockup) */
.rshare-sc.wide { padding: 14px 16px; }
.rshare-sc.wide .hook { font-size: 0.88rem; margin-top: 0; max-width: none; }
.rshare-sc.wide .cat { font-size: 1.25rem; margin-top: 2px; }
.rshare-sc.wide .big { font-size: 2.35rem; margin-top: 2px; }
.rshare-sc.wide .tier { margin-top: 4px; padding: 4px 9px; font-size: 0.7rem; }
.rshare-sc.wide .subs { margin-top: 8px; }
.rshare-sc.wide .subs .c { padding: 5px 6px; }
.rshare-sc.wide .subs .v { font-size: 0.85rem; }
.rshare-sc.wide .art-inline { width: 84px; height: 84px; border-radius: 14px; }
.rshare-sc.wide .hz { font-size: 2.2rem; margin-top: 4px; }

@media (max-width: 720px) {
  .rshare-body { grid-template-columns: 1fr; }
  .rshare-preview-pane { padding: 16px; }
  .rshare-preview-scale { width: 162px; height: 288px; margin: 0 auto; }
  .rshare-preview-scale[data-plat="square"] { width: 180px; height: 180px; }
  .rshare-preview-scale[data-plat="wide"] { width: 220px; height: 116px; }
  .rshare-preview-scale .rshare-preview { transform: scale(0.6); }
  .rshare-preview-scale[data-plat="square"] .rshare-preview { transform: scale(0.6); }
  .rshare-preview-scale[data-plat="wide"] .rshare-preview { transform: scale(0.55); }
  .rshare-controls { padding: 14px; gap: 12px; }
  .rshare-actions { flex-wrap: wrap; }
}
