/* EasyFade — editor component */

.editor{
  display:flex;border:1px solid var(--line);border-radius:16px;overflow:hidden;
  background:var(--surface);box-shadow:0 26px 70px rgba(0,0,0,.45);min-height:540px;
}
#ef-stage{
  flex:1;min-width:0;position:relative;display:flex;align-items:center;justify-content:center;
  /* Deeper padding at the bottom than the other three sides, because #ef-hint
     is absolutely positioned down there. The photo is centred in the content
     box, so reserving that band is what stops a tall image growing down into
     the hint and making it unreadable. Restyling the hint instead — a chip, a
     backdrop — would fix legibility by putting a box on top of someone's
     photo, which is the thing this editor exists to avoid. */
  padding:26px 26px 46px;overflow:hidden;background:
    radial-gradient(120% 100% at 50% 0%, #151922 0%, #0d1015 70%);
}
#ef-wrap{position:relative;line-height:0;border-radius:4px;box-shadow:0 18px 46px rgba(0,0,0,.5)}
#ef-wrap.ef-checker{
  background-image:
    linear-gradient(45deg,#20242d 25%,transparent 25%),
    linear-gradient(-45deg,#20242d 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#20242d 75%),
    linear-gradient(-45deg,transparent 75%,#20242d 75%);
  background-size:18px 18px;
  background-position:0 0,0 9px,9px -9px,-9px 0;
  background-color:#262b35;
}
#ef-wrap.ef-solid{background:var(--solidbg,#fff)}
#ef-view,#ef-overlay{display:block;border-radius:4px;max-width:100%}
/* touch-action:none is what stops the phone scrolling the page while a finger
   is dragging a fade handle. Without it the gesture is unusable. */
#ef-overlay{position:absolute;inset:0;touch-action:none;-webkit-user-select:none;user-select:none}

#ef-drop{
  position:absolute;inset:26px;border:2px dashed var(--line2);border-radius:14px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  color:var(--dim);text-align:center;padding:20px;
}
#ef-drop.hot{border-color:var(--accent);background:rgba(124,92,255,.07)}
#ef-drop b{color:var(--text);font-size:17px;display:block}
#ef-drop .sm{font-size:13px;color:var(--faint)}
#ef-hint{position:absolute;left:24px;bottom:18px;color:#5c6474;font-size:11.5px;pointer-events:none;max-width:60%}
#ef-hint b{color:var(--dim);font-weight:600}

.ef-panel{
  width:308px;flex:0 0 308px;border-left:1px solid var(--line);
  display:flex;flex-direction:column;background:var(--surface);
}
.ef-scroll{overflow:auto;padding:16px;flex:1}
.ef-sec{margin-bottom:19px}
.ef-sec h4{
  margin:0 0 9px;font-size:11px;letter-spacing:.09em;text-transform:uppercase;
  color:var(--dim);font-weight:600;
}
.ef-edges{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,33px);gap:6px}
.ef-edges button{
  background:var(--surface2);border:1px solid var(--line);color:var(--dim);border-radius:8px;
  cursor:pointer;font-size:12px;font-family:inherit;display:flex;align-items:center;justify-content:center;
}
.ef-edges button:hover{color:var(--text)}
.ef-edges button.on{background:rgba(124,92,255,.2);border-color:var(--accent);color:#fff}
.ef-edges .mid{background:transparent;border:1px dashed var(--line);cursor:default;color:#454d5e;font-size:10px}
.ef-edges .mid:hover{color:#454d5e}
.ef-t{grid-column:2;grid-row:1}.ef-l{grid-column:1;grid-row:2}
.ef-c{grid-column:2;grid-row:2}.ef-r{grid-column:3;grid-row:2}
.ef-b{grid-column:2;grid-row:3}

.ef-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}
.ef-row label{font-size:12.5px}
.ef-row .val{font-variant-numeric:tabular-nums;color:var(--dim);font-size:12px}
.ef-panel input[type=range]{
  width:100%;-webkit-appearance:none;appearance:none;height:22px;background:transparent;margin:0 0 12px;
}
.ef-panel input[type=range]::-webkit-slider-runnable-track{height:4px;background:#2c313d;border-radius:3px}
.ef-panel input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;width:15px;height:15px;border-radius:50%;background:#fff;margin-top:-5.5px;
  box-shadow:0 1px 4px rgba(0,0,0,.5);cursor:pointer;
}
.ef-panel input[type=range]::-moz-range-track{height:4px;background:#2c313d;border-radius:3px}
.ef-panel input[type=range]::-moz-range-thumb{width:15px;height:15px;border:0;border-radius:50%;background:#fff;cursor:pointer}
.ef-panel select,.ef-panel input[type=text]{padding:8px 9px;font-size:12.5px;border-radius:8px}

.ef-chips{display:flex;gap:6px;flex-wrap:wrap}
.ef-chip{
  background:var(--surface2);border:1px solid var(--line);color:var(--dim);border-radius:999px;
  padding:5px 11px;font-size:12px;cursor:pointer;font-family:inherit;
}
.ef-chip:hover{color:var(--text)}
.ef-chip.on{background:rgba(0,209,178,.14);border-color:var(--accent2);color:#8ff0e2}
.ef-toggle{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--dim);cursor:pointer;margin-top:10px}
.ef-toggle input{accent-color:var(--accent);width:15px;height:15px}
.ef-curveprev{width:100%;height:44px;background:var(--surface2);border:1px solid var(--line);border-radius:8px;display:block;margin-top:10px}
.ef-inline{display:flex;gap:6px}
.ef-inline select{flex:1}

.ef-foot{border-top:1px solid var(--line);padding:12px 16px;display:flex;flex-direction:column;gap:8px}
.ef-foot .btn{width:100%}
.ef-meta{color:var(--faint);font-size:11px;text-align:center}

#ef-recents{display:flex;align-items:center;gap:7px;padding:9px 16px;border-top:1px solid var(--line);flex-wrap:wrap}
.ef-reclabel{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint)}
.ef-rec{
  width:34px;height:34px;border-radius:7px;border:1px solid var(--line2);cursor:pointer;
  background-size:cover;background-position:center;padding:0;
}
.ef-rec:hover{border-color:var(--accent)}
/* Long-press on a thumbnail is our gesture, so stop iOS showing its own image
   callout on top of the menu we are about to open. */
.ef-rec{-webkit-touch-callout:none}
.ef-recclear{background:none;border:0;color:var(--faint);font-size:11.5px;cursor:pointer;font-family:inherit;margin-left:auto}
.ef-recclear:hover{color:var(--text)}

/* ---- the menu behind right-click / long-press on a recent ----
   We take over the native menu on purpose. "Save image as" would hand over
   whatever bitmap happens to be in the thumbnail, which is a 34px square, and
   it would walk straight past the Pro check. Our own menu can save full size
   and can respect the gate. */
.ef-recmenu{
  position:fixed;z-index:60;min-width:190px;padding:5px;border-radius:11px;
  background:var(--surface2);border:1px solid var(--line2);
  box-shadow:0 18px 44px rgba(0,0,0,.55);
}
.ef-recmenu button{
  display:block;width:100%;text-align:left;background:none;border:0;cursor:pointer;
  font-family:inherit;font-size:13.5px;color:var(--text);padding:9px 11px;border-radius:7px;
}
.ef-recmenu button:hover{background:var(--surface3)}
.ef-recmenu button[disabled]{color:var(--faint);cursor:default}
.ef-recmenu button[disabled]:hover{background:none}
.ef-recmenu .sep{height:1px;background:var(--line);margin:4px 6px}
.ef-recmenu .rm-del{color:#ff8f8f}
@media(pointer:coarse){
  .ef-recmenu{min-width:210px}
  .ef-recmenu button{padding:13px 12px;font-size:15px}
}

@media(max-width:900px){
  .editor{flex-direction:column;min-height:0}
  #ef-stage{min-height:340px}
  .ef-panel{width:100%;flex:0 0 auto;border-left:0;border-top:1px solid var(--line)}
  .ef-scroll{max-height:none}
  #ef-hint{display:none !important}
}

/* ---------------- phones ---------------- */
@media(max-width:640px){
  .editor{border-radius:14px}
  #ef-stage{padding:14px;min-height:290px}
  #ef-drop{inset:14px;padding:14px}
  #ef-drop b{font-size:15.5px}

  .ef-scroll{padding:14px}
  .ef-sec{margin-bottom:16px}

  /* thumb-sized targets everywhere */
  .ef-edges{grid-template-rows:repeat(3,44px);gap:7px}
  .ef-edges button{font-size:13px}
  /* 44px is the smallest thing a thumb hits reliably, so nothing sits under it */
  .ef-chip{padding:13px 16px;font-size:13px;line-height:1}
  .ef-panel select,.ef-panel input[type=text]{padding:13px 10px;font-size:16px}  /* 16px stops iOS zooming on focus */
  .ef-panel input[type=range]{height:44px}
  .ef-panel input[type=range]::-webkit-slider-thumb{width:22px;height:22px;margin-top:-9px}
  .ef-panel input[type=range]::-moz-range-thumb{width:22px;height:22px}
  .ef-toggle{padding:6px 0}
  .ef-toggle input{width:19px;height:19px}

  /* the two things people actually came to press stay in reach */
  .ef-foot{
    position:sticky;bottom:0;z-index:5;
    background:linear-gradient(180deg,rgba(18,21,28,.86),var(--surface) 40%);
    backdrop-filter:blur(8px);padding:12px 14px;
  }
  .ef-foot .btn{padding:13px}
  .ef-rec{width:40px;height:40px}
}

/* --- the mode row, and the one-line note under it ---------------------------
   Added when the site caught up with the Canva app's three modes. The chips
   reuse .ef-chip so the two surfaces look like the same product; only the
   selected state and the hint line are new. */
.ef-hintline{
  margin:8px 0 0;
  font-size:12.5px;
  line-height:1.5;
  color:var(--muted, #6b7080);
}
#ef-modes .ef-chip[aria-checked="true"],
#ef-shapes .ef-chip[aria-checked="true"]{
  border-color:#8B3DFF;
  background:rgba(139,61,255,.10);
  color:#8B3DFF;
}
#ef-shapes .ef-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 9px;
  min-width:0;
}
#ef-shapes .ef-chip svg{ display:block; }
