/* ============================
READY-TO-SHARE (GALLERY) — LIGHT SAAS REFACTOR
Copy/paste this ENTIRE FILE over /static/ready-to-share-gallery.css
Keeps: green badges (ok), badge placement, grid, interactions.
Changes: overall theme from dark panels to light SaaS surfaces.
============================ */

/* -----------------------------------
   Theme tokens (LIGHT SAAS)
----------------------------------- */
:root {
  /* App background */
  --bg: #f6f7f9;

  /* Surfaces */
  --panel: #ffffff;
  --panel2: #fbfbfc; /* subtle alternate */
  --panel3: #f1f3f5; /* muted surface */

  /* Text */
  --text: #111827;
  --muted: #6b7280;

  /* Lines / borders */
  --line: rgba(17, 24, 39, 0.10);
  --line-strong: rgba(17, 24, 39, 0.14);

  /* Accent (kept for toggles) */
  --accent: #2563eb;

  /* KEEP green badge color */
  --mint-green-rgb: 34,139,34;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 1px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.10);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.14);

  /* Radius */
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(37,99,235,0.08), transparent),
    radial-gradient(900px 520px at 80% 10%, rgba(14,165,233,0.08), transparent),
    var(--bg);
  color: var(--text);
}

/* -----------------------------------
   Header
----------------------------------- */

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 20;

  /* light sticky bar */
  backdrop-filter: blur(10px);
  background: rgba(246, 247, 249, 0.86);
  border-bottom: 1px solid var(--line);

  padding: 8px 18px 14px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-height: 44px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.help-btn { opacity: 0.9; }
.help-btn:hover { opacity: 1; }

.settings-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
  border-radius: 10px;

  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f6f7f9);
  color: var(--muted);
  font-size: 22px;
  text-decoration: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: var(--shadow-sm);

  transition:
    color 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.settings-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.settings-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.settings-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
  overflow: visible;
  transform: translateY(-1px);
}

.portal-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--muted);
  white-space: nowrap;
}

.listing-address {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.banner-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.banner-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

/* Settings Panel */
.settings-panel {
  position: fixed;
  top: 64px;
  right: 18px;
  z-index: 40;

  width: min(320px, calc(100vw - 36px));

  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-lg);

  backdrop-filter: blur(12px);
}

.settings-panel-inner {
  padding: 16px 16px 18px;
}

.settings-panel.is-hidden { display: none; }

.settings-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}

.settings-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.35;
}

.settings-platforms {
  display: grid;
  gap: 8px;
}

/* Platform toggles */
.platform-toggle {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 10px;
  font-size: 13px;
  cursor: pointer;

  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--panel2);

  transition: border-color 120ms ease, background 120ms ease;
}

.platform-toggle:hover {
  border-color: var(--line);
  background: #ffffff;
}

.platform-toggle input {
  accent-color: var(--accent);
}

/* -----------------------------------
   Stats Grid
----------------------------------- */

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-tile {
  padding: 12px 14px;
  border-radius: var(--r-lg);

  background: var(--panel);
  border: 1px solid var(--line);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  box-shadow: var(--shadow-sm);

  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

button.stat-tile {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.stat-filter:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.stat-tile.primary {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), #ffffff);
  box-shadow: var(--shadow-md);
}

.stat-filter.is-active {
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), #ffffff);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.15),
    0 10px 26px rgba(37, 99, 235, 0.16);
}

.stat-filter.is-active .stat-label {
  color: #334155;
}

.stat-filter[data-filter="scenes-left"].is-active {
  border-color: rgba(34, 197, 94, 0.65);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), #ffffff);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.32),
    0 0 0 6px rgba(34, 197, 94, 0.16),
    0 12px 28px rgba(16, 185, 129, 0.27);
}

@media (prefers-reduced-motion: no-preference) {
  .stat-filter[data-filter="scenes-left"].is-active {
    animation: scenes-left-active-pulse 2.4s ease-in-out infinite;
  }
}

.stat-value {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.2px;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

@media (hover: hover) {
  .stat-tile:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: #ffffff;
    box-shadow: var(--shadow-md);
  }
}

@keyframes scenes-left-active-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.32),
      0 0 0 4px rgba(34, 197, 94, 0.14),
      0 12px 28px rgba(16, 185, 129, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.38),
      0 0 0 10px rgba(34, 197, 94, 0.22),
      0 14px 32px rgba(16, 185, 129, 0.3);
  }
}

/* -----------------------------------
   Stats Instructions Callout
----------------------------------- */

.stats-instructions {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  position: relative;

  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);

  text-align: center;
}

.stats-instructions.is-hidden {
  display: none;
}

.stats-instructions-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stats-instructions-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.stats-instructions-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  color: var(--text);
}

.stats-instructions-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 720px;
  margin: 0 auto;
}

/* Slight emphasis for final confirmation step */
.instruction-step:last-child {
  margin-top: 4px;
}

/* Responsive tuning */
@media (max-width: 760px) {
  .stats-instructions {
    padding: 14px 14px;
    border-radius: 16px;
  }
  .stats-instructions-title { font-size: 13.5px; }
  .stats-instructions-sub { font-size: 12.5px; }
}

/* -----------------------------------
   Gallery Grid
----------------------------------- */

.gallery-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* -----------------------------------
   Scene Tile
----------------------------------- */

.scene-tile {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;

  border: 1px solid var(--line);
  background: var(--panel);

  /* lighter shadow = less perceived blur */
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.scene-tile.is-filter-hidden {
  display: none;
}

.scene-tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.scene-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.scene-tile a {
  color: inherit;
  text-decoration: none;
}

/* -----------------------------------
   Shared States
   KEEP green colored badging
----------------------------------- */

/* Fully shared overlay: lighter, less "heavy dark mask" */
.scene-tile .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* force true full-bleed coverage */
  border-radius: 0;
  pointer-events: none;

  background: rgba(17, 24, 39, 0.44);

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fully shared pill: KEEP green */
.scene-tile .check {
  font-size: 14px;
  font-weight: 800;

  /* force badge color */
  color: rgba(var(--mint-green-rgb),0.95) !important;

  border: 1px solid rgba(var(--mint-green-rgb),0.35);
  padding: 8px 14px;
  border-radius: 999px;

  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);

  /* prevent link inheritance */
  text-decoration: none;
}

/* Partial shared badge: KEEP green */
.scene-tile .badge {
  position: absolute;
  top: 10px;
  right: 10px;

  font-size: 12px;
  font-weight: 700;

  padding: 6px 11px;
  border-radius: 999px;

  color: rgba(var(--mint-green-rgb),0.95);

  /* keep “green badge” but modernize surface */
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(var(--mint-green-rgb),0.55);

  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

/* -----------------------------------
   Gallery Footer
----------------------------------- */

.gallery-footer {
  margin-top: 40px;
  padding: 60px 20px 70px;
  border-top: 1px solid var(--line);

  background:
    radial-gradient(900px 360px at 50% 0%, rgba(37,99,235,0.06), transparent),
    var(--bg);
}

.footer-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.footer-crafted {
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin-bottom: 10px;
}

.footer-client {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  color: var(--text);
}

.footer-byline,
.footer-location,
.footer-year {
  color: var(--muted);
}

.footer-byline {
  font-size: 14px;
  margin-bottom: 6px;
}

.footer-location {
  font-size: 13px;
}

.footer-year {
  margin-top: 16px;
  font-size: 12px;
}

.footer-logo {
  margin-top: 28px;
}

.footer-logo img {
  width: 72px;
  opacity: 0.9;
  /* your SVG is currently white-on-black; it will look harsh on light.
     If you can swap to a dark logo SVG, do it.
     Otherwise keep as-is; the opacity helps. */
}

/* -----------------------------------
   Responsive
----------------------------------- */

@media (max-width: 900px) {
  .header-row {
    align-items: center;
    justify-content: space-between;
  }

  .banner-logo-link {
    width: 40px;
    height: 40px;
  }

  .banner-logo {
    width: 27px;
    height: 27px;
  }

  .listing-address {
    font-size: 14px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .portal-title {
    display: none;
  }
}

@media (max-width: 980px) {
  .stats-grid { gap: 10px; }
  .stat-tile { padding: 10px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
}

@media (max-width: 860px) {
  .stats-grid { gap: 8px; }
  .stat-tile {
    padding: 9px 10px;
    border-radius: 12px;
  }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 11px; }
}

@media (max-width: 760px) {
  .stat-tile { padding: 8px 9px; }
  .stat-value { font-size: 17px; }
  .stat-label { font-size: 10.5px; }
}

/* -----------------------------------
   THE DETAIL PAGE
----------------------------------- */

/* Layout */
.detail-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.media-frame {
  position: relative;
  aspect-ratio: 16 / 9;

  /* Create a clean stacking context */
  isolation: isolate;

  max-height: 70vh;
  width: 100%;

  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.media-frame img,
.media-frame video {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 160ms ease;
}

/* Inline download button inside media frame */
.media-frame .download-overlay {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 12;

  pointer-events: auto;
}

.media-download-below {
  display: none;
}

.media-download-below .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;
  padding: 0 26px;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;

  color: #1a1200;

  background: linear-gradient(
    180deg,
    #ffd95a 0%,
    #f2b800 100%
  );

  border: 1px solid #d6a400;
  border-radius: 28px;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);

  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.media-download-below .secondary-action:hover {
  filter: brightness(1.05);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

.media-download-below .secondary-action:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

/* Lightbox download button should match gold CTA */
.lightbox-actions-row .gold-cta {
  background: linear-gradient(
    180deg,
    #ffd95a 0%,
    #f2b800 100%
  );

  border: 1px solid #d6a400;
  color: #1a1200;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);
}

/* Gold CTA (shared by photo + video downloads) */
.gold-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;
  padding: 0 26px;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;

  color: #1a1200;

  background: linear-gradient(
    180deg,
    #ffd95a 0%,
    #f2b800 100%
  );

  border: 1px solid #d6a400;
  border-radius: 28px;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);

  text-decoration: none;

  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

.gold-cta:hover {
  filter: brightness(1.05);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

.gold-cta:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.media-description {
  margin-top: 12px;
  margin-bottom: 12px;
}

.lightbox-media-preview .gold-cta {
  backdrop-filter: blur(6px);

  min-height: 34px;
  padding: 0 16px;

  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;

  border-radius: 18px;

  /* FORCE gold appearance */
  background: linear-gradient(
    180deg,
    #ffd95a 0%,
    #f2b800 100%
  ) !important;

  border: 1px solid #d6a400 !important;
  color: #1a1200 !important;

  box-shadow:
    0 6px 14px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);
}

.lightbox-media-preview .gold-cta:hover {
  filter: brightness(1.05);
}

.media-metadata-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.media-metadata-header {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(180deg, #f9fbff, #f3f7fd);
  color: #5b77a3;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-metadata-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
}

.media-metadata-row:last-child {
  border-bottom: 0;
}

.media-metadata-row:nth-child(odd) {
  background: rgba(245, 248, 253, 0.8);
}

.media-metadata-row:nth-child(even) {
  background: rgba(252, 253, 255, 0.9);
}

.media-metadata-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #7a8598;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  white-space: nowrap;
  padding-top: 1px;
}

.media-metadata-value {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-metadata-debug {
  margin-top: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.7);
  padding: 8px 10px;
}

.media-metadata-debug summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
}

.media-metadata-debug-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 5px 8px;
  font-size: 12px;
  color: #1f2937;
}

.metadata-debug-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

@media (max-width: 620px) {
  .media-metadata-debug-grid {
    grid-template-columns: 1fr;
  }
}

/* Overlays */
.detail-container .overlay {
  position: absolute;
  z-index: 10;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: white;
  backdrop-filter: blur(6px);
}

.detail-container .overlay.back {
  top: 12px;
  left: 12px;
  text-decoration: none;
}

.detail-container .overlay.counter {
  top: 12px;
  right: 12px;
}

/* Base counter positioning */
.counter-neutral {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);

  /* visual sizing */
  padding: 8px 16px;
  width: fit-content;

  /* typography */
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;

  /* styling */
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
}

/* Right-side shared counter */
.counter-shared {
  top: 12px;
  right: 12px;

  font-size: 13px;
  font-weight: 700;

  padding: 8px 14px;
  border-radius: 999px;

  color: rgba(80, 200, 120, 1) !important;

  background: linear-gradient(
    180deg,
    rgba(20,40,30,0.9),
    rgba(12,28,20,0.9)
  );

  border: 1px solid rgba(var(--mint-green-rgb),0.55);

  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(var(--mint-green-rgb),0.12);

  backdrop-filter: blur(8px);
}

.detail-container .overlay.media-toggle {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.media-toggle button {
  border: none;
  background: transparent;
  color: #bbb;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;

  white-space: nowrap;
  flex: 0 0 auto;
  min-width: max-content;
}

.share-inline {
  border-radius: 999px;
  padding: 7px 14px;
  width: 100%;

  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;

  color: #065f46; /* deep green text */

  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.18),
    rgba(var(--mint-green-rgb),0.10)
  );

  border: 1px solid rgba(var(--mint-green-rgb),0.45);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 1px 2px rgba(16,24,40,0.06);

  cursor: pointer;
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.share-inline:hover {
  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.26),
    rgba(var(--mint-green-rgb),0.14)
  );
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 4px 10px rgba(16,24,40,0.10);
}

.share-inline:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.media-toggle .active {
  background: rgba(110,168,255,0.35);
  color: white;
}

/* Platforms */
.platforms {
  display: grid;
  gap: 16px;
}

.platform-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 15px;

  /* light SaaS surface */
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

/* tighter look when caption is collapsed */
.platform-card:not(:has(details[open])) {
  padding-bottom: 10px;
}

.platform-card.done {
  border-color: rgba(var(--mint-green-rgb),0.45);
  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.08),
    rgba(255,255,255,1)
  );
}

.platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.platform-header h3 {
  margin: 0;
}

/* Platform row layout */
.platform-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 104px;
  grid-template-areas: "name caption action";
  gap: 8px;
  align-items: start;
}

/* Platform name */
.platform-name {
  grid-area: name;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;

  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  padding-top: 6px;
  min-width: 0;
}

/* Caption column */
.caption-cell {
  grid-area: caption;
  cursor: pointer;
  position: relative;
  min-width: 0;
}

.caption-preview {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;

  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;

  min-height: calc(1.45em * 4 + 20px);
}
/* Expanded = same element, no clamp */
.caption-cell[data-expanded="true"] .caption-preview {
  -webkit-line-clamp: unset;
  display: block;
}

/* Actions column */
.platform-actions {
  grid-area: action;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  width: 104px;
}


.platform-name .status-badge {
  appearance: none;
  -webkit-appearance: none;

  display: inline-flex;
  align-items: center;

  margin-top: 6px;
  padding: 3px 6px;

  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;

  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);

  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.platform-name .status-badge.on {
  border-color: rgba(var(--mint-green-rgb),0.45);
  background: rgba(var(--mint-green-rgb),0.12);
  color: rgba(var(--mint-green-rgb),0.9);
}

.platform-name .status-badge:hover {
  background: rgba(255,255,255,0.06);
}

.platform-name .status-badge.pending {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

/* Footer */
footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.share-helper {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 140ms ease;
}

.share-helper:hover {
  background: rgba(255,255,255,0.14);
}

.share-helper.copied {
  border-color: rgba(var(--mint-green-rgb),0.6);
  background: rgba(var(--mint-green-rgb),0.25);
  color: rgba(var(--mint-green-rgb),1);
  animation: pop 160ms ease;
}

/* Carousel navigation arrows */
.carousel-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.85;
  transition: all 140ms ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.carousel-nav:hover {
  opacity: 1;
  background: rgba(0,0,0,0.7);
}

.carousel-nav.prev {
  left: 12px;
}

.carousel-nav.next {
  right: 12px;
}

@keyframes pop {
  from { transform: scale(0.96); }
  to   { transform: scale(1); }
}

/* Next */
.next-action {
  display: flex;
  justify-content: flex-end;
}

.next-action a {
  text-decoration: none;
  font-weight: 600;
  color: rgba(110,168,255,0.95);
}

/* Lightbox */
.lightbox.hidden {
  display: none;
}

.platform-instruction {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;

  width: min(520px, calc(100vw - 24px));
  margin: 12px auto 40px;

  display: flex;
  flex-direction: column;

  background: var(--panel);
  border-radius: 20px;
  padding: 18px;

  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lightbox-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.lightbox-close {
  background: rgba(17, 24, 39, 0.06);
  border: 1px solid var(--line);
  color: #374151; /* stronger than muted */

  width: 44px;
  height: 44px;

  border-radius: 999px;

  font-size: 26px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition:
    background 120ms ease,
    color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.lightbox-close:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.12);
  box-shadow: 0 4px 10px rgba(16,24,40,0.12);
  transform: translateY(-1px);
}

.lightbox-close:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(16,24,40,0.12);
}

.lightbox-close-icon {
  width: 20px;
  height: 20px;

  stroke: #374151;
  stroke-width: 2.75;
  stroke-linecap: round;

  fill: none;

  /* HARD center guarantee */
  display: block;
}

.lightbox-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
}
/* -----------------------------------
   Instruction Flow (Lightbox)
----------------------------------- */

.instruction-flow {
  display: grid;
  gap: 12px;
}

.instruction-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: flex-start;

  padding: 10px;
  border-radius: 14px;

  background: var(--panel2);
  border: 1px solid var(--line);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 16px;
  font-weight: 800;

  color: #ffffff;
  background: linear-gradient(
    180deg,
    rgba(37,99,235,0.9),
    rgba(37,99,235,0.75)
  );

  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}

.step-content {
  display: grid;
  gap: 10px;
}

.step-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
}

.step-instruction {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.step-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 4px;
}

/* Prevent background scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
  height: 100vh;
}

.primary-action {
  border-radius: 999px;
  padding: 10px 18px;

  font-weight: 700;
  font-size: 13px;

  color: #065f46;

  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.22),
    rgba(var(--mint-green-rgb),0.14)
  );

  border: 1px solid rgba(var(--mint-green-rgb),0.45);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 2px 6px rgba(16,24,40,0.12);

  cursor: pointer;
}

.primary-action.copied {
  background: rgba(var(--mint-green-rgb),0.25);
  border-color: rgba(var(--mint-green-rgb),0.6);
  color: rgba(var(--mint-green-rgb),1);
}

.secondary-action {
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);

  text-decoration: none;
}

.secondary-action:hover,
.secondary-action:focus,
.secondary-action:visited {
  text-decoration: none;
}

.mark-shared {
  border-radius: 999px;
  padding: 12px 18px;

  font-weight: 700;
  font-size: 14px;

  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.18),
    rgba(var(--mint-green-rgb),0.10)
  );

  border: 1px solid rgba(var(--mint-green-rgb),0.45);
  color: #065f46;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 2px 8px rgba(16,24,40,0.12);

  cursor: pointer;
}

.lightbox-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.lightbox-media-preview {
  position: relative;
  aspect-ratio: 16 / 9;

  width: 70%;
  margin-left: auto;
  margin-right: 0;

  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

@media (max-width: 600px) {
  .lightbox-media-preview {
    width: 100%;
    margin-left: 0;
  }
}

.lightbox-media-preview img,
.lightbox-media-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lightbox-media-preview .download-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 6;

  pointer-events: auto;
}

.lightbox-media-preview .lightbox-actions-row {
  position: absolute;
  bottom: 14px;
  right: 14px;

  z-index: 5;

  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.lightbox-caption-block textarea {
  width: 100%;
  min-height: 88px;
  max-height: 120px;

  padding: 16px 18px;

  font-size: 14px;
  line-height: 1.5;
  color: var(--text);

  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;

  resize: none;
  overflow-y: auto;

  position: relative;
  z-index: 1;
}

.lightbox-caption-block {
  position: relative;

  background: none;
  border: none;
  padding: 0;
}

.lightbox-caption-block {
  position: relative;
}

.lightbox-caption-block .text-fade {
  position: absolute;

  /* match textarea padding exactly */
  left: 18px;
  right: 18px;
  bottom: 8px;

  height: 36px;

  pointer-events: none;
  z-index: 2;

  /* no rounding — prevents panel look */
  border-radius: 0;

  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,1)
  );
}

.caption-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.caption-viewport {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.lightbox-submit {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.lightbox-share-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.lightbox-share-row.hidden {
  display: none;
}

.lightbox-share-row input {
  flex: 1;
  min-width: 0;

  padding: 10px 14px;

  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;

  background: #ffffff;
  color: var(--text);

  border-radius: 999px;
  border: 1px solid var(--line);

  box-shadow: inset 0 1px 2px rgba(16,24,40,0.06);

  outline: none;
}

.lightbox-share-row input:focus {
  border-color: rgba(var(--mint-green-rgb),0.6);
  box-shadow:
    inset 0 1px 2px rgba(16,24,40,0.06),
    0 0 0 3px rgba(var(--mint-green-rgb),0.18);
}

.lightbox-share-row a {
  padding: 10px 16px;

  font-size: 12.5px;
  font-weight: 700;

  border-radius: 999px;

  color: #065f46;

  background: linear-gradient(
    180deg,
    rgba(var(--mint-green-rgb),0.22),
    rgba(var(--mint-green-rgb),0.14)
  );

  border: 1px solid rgba(var(--mint-green-rgb),0.45);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 2px 6px rgba(16,24,40,0.12);

  text-decoration: none;
  white-space: nowrap;
}

.lightbox-share-row a:hover {
  background: rgba(110,168,255,0.5);
}

/* -----------------------------------
   Shared Toggle (State, not Action)
----------------------------------- */

.shared-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px 14px;
  border-radius: 14px;

  background: var(--panel);
  border: 1px solid var(--line);

  cursor: pointer;
  user-select: none;

  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.shared-toggle-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.shared-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;

  background: rgba(17, 24, 39, 0.12);
  transition: background 120ms ease;
}

.shared-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;

  width: 20px;
  height: 20px;
  border-radius: 50%;

  background: #ffffff;
  box-shadow: 0 2px 6px rgba(16,24,40,0.25);

  transition: transform 120ms ease;
}

/* Shared = ON */

.shared-toggle.is-on {
  border-color: rgba(var(--mint-green-rgb),0.45);
  background: rgba(var(--mint-green-rgb),0.08);
}

.shared-toggle.is-on .shared-toggle-label {
  color: rgba(var(--mint-green-rgb),0.95);
}

.shared-toggle.is-on .shared-toggle-track {
  background: rgba(var(--mint-green-rgb),0.55);
}

.shared-toggle.is-on .shared-toggle-thumb {
  transform: translateX(20px);
}

.shared-toggle.pending {
  opacity: 0.8;
  cursor: wait;
  pointer-events: none;
}

/* lightbox-body has gap:16px; this pulls the download row up
   so the effective space under the media matches caption-actions (8px) */


.mark-shared {
  width: 100%;
  font-size: 14px;
}

@media (min-width: 900px) {
  .media-frame {
    max-height: 65vh;
  }
}

@media (max-width: 600px) {
  .media-frame {
    max-height: 55vh;
  }

  .media-frame img,
  .media-frame video {
    object-position: center center;
  }
}

@media (min-width: 900px) {
  .caption-preview {
    -webkit-line-clamp: 5;
    min-height: calc(1.4em * 5);
  }
}

@media (max-width: 1100px) {
  .platform-row {
    grid-template-columns: 72px minmax(0, 1fr) 100px;
    gap: 10px;
  }

  .platform-name {
    font-size: 14px;
  }

  .platform-actions {
    width: 100px;
  }

  .share-inline {
    font-size: 12px;
    padding: 7px 12px;
  }
}

@media (max-width: 760px) {
  .platform-card {
    padding: 14px 12px;
  }

  .platform-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name action"
      "caption caption";
    column-gap: 10px;
    row-gap: 10px;
  }

  .platform-name {
    padding-top: 0;
    gap: 6px;
    font-size: 17px;
  }

  .platform-name .status-badge {
    margin-top: 0;
    font-size: 10px;
  }

  .platform-actions {
    width: auto;
    justify-self: end;
    align-self: start;
  }

  .share-inline {
    min-width: 124px;
    width: auto;
    font-size: 12px;
    padding: 8px 14px;
  }

  .caption-preview {
    font-size: 13px;
    line-height: 1.42;
    -webkit-line-clamp: 3;
    min-height: calc(1.42em * 3 + 20px);
  }
}

/* Hide all native video controls */
#media-video::-webkit-media-controls {
  display: none !important;
}

#media-video::-webkit-media-controls-enclosure {
  display: none !important;
}

#media-video {
  outline: none;
  background: black;
}

/* Centered custom play overlay */
.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;

  /* Must be above video (1) and below UI overlays (10) */
  z-index: 5;
}


.video-play-button {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  line-height: 0;
}

/* SVG icon sizing + color */
.video-play-button .video-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
  transform: translateX(1px);
}

.video-play-overlay.hidden {
  display: none;
}

/* Optical centering for play triangle only */
.video-play-button.is-play .video-icon {
  transform: translateX(1px);
}

/* Optical centering for pause icon only */
.video-play-button.is-pause .video-icon {
  transform: translateX(-0px);
}

/* =========================================
   MOBILE CLEANUP: HIDE IMAGE-ATTACHED UI
   ========================================= */

@media (max-width: 768px) {

  /* Top counters */
  .detail-container .counter-neutral,
  .detail-container .counter-shared {
    display: none;
  }

  /* Carousel navigation arrows */
  .detail-container .carousel-nav {
    display: none;
  }

  /* OPTIONAL: hide center play overlay on mobile */
  /* Uncomment if you want zero overlay chrome */
  /*
  .video-play-overlay {
    display: none;
  }
  */
}
