/* LittleCam editor overlay */
.lce-lock { overflow: hidden; }
.lce-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  background: #f6f6fa;
}
.lce-overlay.open { display: block; }
.lce-shell { display: flex; flex-direction: column; height: 100%; }

.lce-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: #fff; border-bottom: 1px solid #ececf2;
}
.lce-title { font-weight: 700; color: #1f3026; font-size: 15px; }
.lce-private { font-weight: 500; color: #5b8a72; font-size: 12.5px; margin-left: 8px; }
.lce-top-right { display: flex; align-items: center; gap: 10px; }
.lce-credits { font-size: 13px; font-weight: 700; color: #3f7551; }

.lce-body { flex: 1; display: flex; min-height: 0; }
.lce-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 14px; gap: 10px; }
.lce-canvas-wrap {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.lce-canvas-wrap canvas {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 12px; box-shadow: 0 10px 40px rgba(27, 39, 51, .14);
  background:
    conic-gradient(#e8e8ee 0 25%, #f7f7fb 0 50%, #e8e8ee 0 75%, #f7f7fb 0) 0 0/24px 24px;
  max-width: 100%; max-height: 100%;
  touch-action: none;
}
.lce-canvas-wrap canvas.lce-hit { background: transparent; box-shadow: none; cursor: grab; }
.lce-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(27, 39, 51, .88); color: #fff; font-size: 14px; font-weight: 600;
  padding: 14px 22px; border-radius: 12px; z-index: 5; white-space: nowrap;
}

.lce-layerbar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px;
  background: #fff; border: 1px solid #ececf2; border-radius: 12px; padding: 8px 14px;
}
.lce-layerbar label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #5a6772; }
.lce-layerbar input[type=range] { width: 120px; accent-color: #3f7551; }

.lce-downloads { display: flex; gap: 10px; justify-content: center; }

.lce-btn {
  border: 0; border-radius: 999px; font-weight: 700; cursor: pointer;
  padding: 11px 22px; font-size: 14.5px; font-family: inherit; transition: .15s;
}
.lce-btn.primary { background: #3f7551; color: #fff; box-shadow: 0 6px 18px rgba(63, 117, 81, .35); }
.lce-btn.primary:hover { background: #346843; }
.lce-btn.primary small { font-weight: 600; opacity: .85; margin-left: 4px; }
.lce-btn.secondary { background: #fff; color: #1f3026; border: 1.5px solid #d9dde6; }
.lce-btn.secondary:hover { border-color: #3f7551; color: #3f7551; }
.lce-btn.ghost { background: transparent; color: #5a6772; padding: 8px 12px; }
.lce-btn.ghost:hover { color: #1f3026; }
.lce-btn.small { padding: 7px 14px; font-size: 12.5px; background: #f1f2f7; color: #1f3026; }
.lce-btn.small.danger { background: #ffe7df; color: #b04a32; }

.lce-panel {
  width: 320px; flex-shrink: 0; background: #fff; border-left: 1px solid #ececf2;
  display: flex; flex-direction: column; min-height: 0;
}
.lce-tabs { display: flex; border-bottom: 1px solid #ececf2; }
.lce-tabs button {
  flex: 1; padding: 13px 4px; border: 0; background: none; font-weight: 700; font-size: 13.5px;
  color: #8a94a0; cursor: pointer; border-bottom: 2.5px solid transparent; font-family: inherit;
}
.lce-tabs button.active { color: #3f7551; border-bottom-color: #3f7551; }
.lce-tabpane { flex: 1; overflow-y: auto; padding: 12px; }

.lce-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lce-chip {
  border: 1px solid #d9dde6; background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; color: #5a6772; cursor: pointer; font-family: inherit;
}
.lce-chip.active { background: #1f3026; border-color: #1f3026; color: #fff; }

.lce-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lce-tile {
  position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  padding: 0; background: #f1f2f7; cursor: pointer; aspect-ratio: 3/4;
}
.lce-grid.stickers .lce-tile, .lce-grid.colors .lce-tile { aspect-ratio: 1; }
.lce-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lce-grid.stickers .lce-tile img { object-fit: contain; padding: 6px; }
.lce-tile:hover { border-color: #a8c8ab; }
.lce-tile-none span {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 12px; font-weight: 700; color: #8a94a0; text-align: center;
}
.lce-tile.color { border: 2px solid #ececf2; }

.lce-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #1f3026; color: #fff; padding: 13px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 1200; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  max-width: min(92vw, 480px); text-align: center;
}

.lce-modal {
  position: fixed; inset: 0; z-index: 1100; background: rgba(20, 26, 34, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
/* the hidden attribute must always win over display rules above */
.lce-modal[hidden], .lce-toast[hidden], .lce-status[hidden] { display: none !important; }
.lce-modal-card {
  position: relative; background: #fff; border-radius: 20px; padding: 30px 28px 22px;
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.lce-modal-card h3 { margin: 0 0 6px; font-size: 22px; color: #1f3026; }
.lce-modal-sub { margin: 0 0 18px; color: #5a6772; font-size: 14px; }
.lce-modal-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 26px; color: #8a94a0; cursor: pointer; line-height: 1;
}
.lce-plans { display: grid; grid-template-columns: 1fr; gap: 9px; }
.lce-plan {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; border: 1.5px solid #d9dde6; background: #fff;
  border-radius: 13px; padding: 13px 16px; cursor: pointer; font-family: inherit; transition: .15s;
}
.lce-plan:hover { border-color: #3f7551; box-shadow: 0 8px 22px rgba(63, 117, 81, .18); }
.lce-plan.featured { border-color: #3f7551; border-width: 2px; background: #fbfdfb; }
.lce-plan-l { display: flex; flex-direction: column; min-width: 0; }
.lce-plan-l strong { font-size: 15px; color: #1f3026; }
.lce-plan-l small { color: #8a94a0; font-size: 12px; margin-top: 2px; }
.lce-price { font-size: 22px; font-weight: 850; color: #3f7551; white-space: nowrap; }
.lce-price small { font-size: 12px; font-weight: 700; color: #8a94a0; }
.lce-badge {
  position: absolute; top: -9px; right: 14px; white-space: nowrap;
  background: #1f3026; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 3px 9px;
}
.lce-perks { margin: 14px 0 0; text-align: center; color: #5f7168; font-size: 12.5px; font-weight: 650; line-height: 1.6; }
.lce-modal-foot { margin: 14px 0 0; text-align: center; color: #8a94a0; font-size: 12px; line-height: 1.7; }
.lce-modal-foot a { color: #3f7551; font-weight: 700; }
.lce-auth-row { display: flex; gap: 8px; margin-bottom: 10px; }
.lce-auth-row input {
  flex: 1; min-width: 0; border: 1.5px solid #d9dde6; border-radius: 999px;
  padding: 11px 16px; font-size: 14.5px; font-family: inherit; outline: none;
}
.lce-auth-row input:focus { border-color: #3f7551; }

/* ---- warm loading state ---- */
.lce-loader {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  background: rgba(255,255,255,.94); border-radius: 18px; padding: 28px 30px;
  box-shadow: 0 20px 50px rgba(27,39,51,.18); width: min(90%, 340px);
}
.lce-loader-ring {
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px;
  border: 4px solid #e3efe6; border-top-color: #3f7551;
  animation: lce-spin 1s linear infinite;
}
.lce-loader-ring span { animation: lce-bob 1.6s ease-in-out infinite; }
@keyframes lce-spin { to { transform: rotate(360deg); } }
@keyframes lce-bob { 0%,100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
.lce-loader-msg { font-size: 16px; font-weight: 800; color: #1f3026; }
.lce-loader-sub { font-size: 13px; font-weight: 600; color: #5b8a72; line-height: 1.5; }

/* ---- first-time coach mark ---- */
.lce-coach {
  position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center;
  background: rgba(20,26,34,.5); padding: 18px;
}
.lce-coach-card {
  background: #fff; border-radius: 18px; padding: 22px 22px 18px; width: min(380px, 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.lce-coach-card strong { display: block; font-size: 18px; color: #1f3026; margin-bottom: 12px; }
.lce-coach-card ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.lce-coach-card li { font-size: 14px; color: #40504a; line-height: 1.45; }
.lce-coach-card .lce-btn { width: 100%; }

/* ---- suggested scenes bar ---- */
.lce-suggest { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lce-suggest-label { font-size: 13px; font-weight: 700; color: #5a6772; }
.lce-suggest-row { display: flex; gap: 8px; }
.lce-suggest-thumb {
  width: 46px; height: 60px; border-radius: 9px; overflow: hidden; border: 2px solid #d9dde6;
  background: #f1f2f7; cursor: pointer; padding: 0;
}
.lce-suggest-thumb:hover { border-color: #3f7551; }
.lce-suggest-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- paywall: result preview + deal countdown ---- */
.lce-deal {
  background: #fff3e6; color: #b5651d; border: 1px solid #ffd9a8; border-radius: 10px;
  padding: 9px 12px; text-align: center; font-size: 13px; font-weight: 700; margin-bottom: 14px;
}
.lce-deal b { color: #d8480b; }
.lce-pw-preview { margin: 0 0 16px; text-align: center; }
.lce-pw-preview img {
  max-width: 200px; max-height: 200px; width: auto; border-radius: 14px;
  box-shadow: 0 14px 34px rgba(27,39,51,.2); margin: 0 auto;
}
.lce-pw-preview figcaption { margin-top: 7px; font-size: 12.5px; font-weight: 700; color: #3f7551; }

@media (max-width: 880px) {
  .lce-body { flex-direction: column; overflow-y: auto; }
  .lce-stage { padding: 10px; }
  .lce-canvas-wrap { min-height: 46vh; }
  .lce-panel { width: 100%; border-left: 0; border-top: 1px solid #ececf2; }
  .lce-tabpane { max-height: 38vh; }
  .lce-grid { grid-template-columns: repeat(4, 1fr); }
  .lce-title { display: none; }
  .lce-modal-card { padding: 22px 18px 18px; }
  .lce-modal-card h3 { font-size: 19px; }
  .lce-pw-preview img { max-width: 150px; max-height: 150px; }
  .lce-plan { padding: 12px 14px; }
  .lce-price { font-size: 20px; }
}
