/* Photo editor (ttc-photo-editor.js) */
dialog.tpe{width:min(1100px,calc(100vw - 24px));max-width:none;height:min(860px,calc(100dvh - 24px));max-height:none;padding:0;border:1px solid #23363D;border-radius:18px;background:#0A1317;color:#E8F1F3;
  display:grid;grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"top top" "stage tabs" "stage panel";overflow:hidden}
dialog.tpe:not([open]){display:none}
dialog.tpe::backdrop{background:#000c}
.tpe-top{grid-area:top;display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #1E2F36}
.tpe-top strong{flex:1;text-align:center;font-size:16px}
.tpe-stage{grid-area:stage;position:relative;display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(#0E191D 0 25%,#0B1418 0 50%) 0 0/24px 24px;min-height:0;padding:12px}
.tpe-canvas{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 10px 40px #000a;border-radius:4px}
#ttc-feed-app .tpe-compare,.tpe-compare{position:absolute;left:14px;bottom:14px;height:34px;padding:0 14px;border-radius:17px;border:0;background:#000a;color:#fff!important;font:700 13px Inter,sans-serif;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}
.tpe-tabs{grid-area:tabs;display:flex;gap:4px;padding:10px 12px 0;border-left:1px solid #1E2F36;align-self:start}
#ttc-feed-app .tpe-tabs button,.tpe-tabs button{flex:1;height:36px;border:0;border-radius:10px;background:none;color:#8FA6AD!important;font:700 14px Inter,sans-serif;cursor:pointer;padding:0}
#ttc-feed-app .tpe-tabs button[aria-selected=true],.tpe-tabs button[aria-selected=true]{background:#15242A;color:#3FD2E8!important}
.tpe-panel{grid-area:panel;overflow-y:auto;padding:12px;border-left:1px solid #1E2F36;display:flex;flex-direction:column;gap:12px;min-height:0}
.tpe-filters{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#ttc-feed-app .tpe-filter,.tpe-filter{display:flex;flex-direction:column;align-items:center;gap:4px;padding:4px;border-radius:12px;border:2px solid transparent;background:none;color:#C9D8DC!important;font:600 12px Inter,sans-serif;cursor:pointer}
.tpe-filter canvas{width:100%;aspect-ratio:1;border-radius:8px;display:block}
#ttc-feed-app .tpe-filter[aria-pressed=true],.tpe-filter[aria-pressed=true]{border-color:#3FD2E8;color:#3FD2E8!important}
.tpe-sliders{display:flex;flex-direction:column;gap:6px}
.tpe-slider{display:grid!important;grid-template-columns:96px 1fr 40px;align-items:center;gap:10px;margin:0!important;font-size:13px!important;color:#C9D8DC!important;font-weight:600}
.tpe-slider input{margin:0;padding:0;accent-color:#3FD2E8;height:24px;background:none;border:0}
.tpe-slider output{text-align:right;color:#8FA6AD;font-variant-numeric:tabular-nums}
.tpe-note{margin:0!important;font-size:13px;color:#8FA6AD!important}
.tpe-chips{display:flex;gap:6px;flex-wrap:wrap}
#ttc-feed-app .tpe-chips button,.tpe-chips button{height:36px;padding:0 12px;border-radius:18px;border:1px solid #23363D;background:#0E191D;color:#C9D8DC!important;font:600 13px Inter,sans-serif;cursor:pointer}
#ttc-feed-app .tpe-chips button[aria-pressed=true],.tpe-chips button[aria-pressed=true]{border-color:#3FD2E8;color:#3FD2E8!important;background:#3FD2E812}
@media(max-width:759px){
  dialog.tpe{width:100vw;height:100dvh;border-radius:0;border:0;grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto auto;grid-template-areas:"top" "stage" "tabs" "panel"}
  .tpe-tabs,.tpe-panel{border-left:0}
  .tpe-panel{max-height:34dvh;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .tpe-filters{display:flex;overflow-x:auto;gap:6px;scrollbar-width:none}
  .tpe-filter{flex:none;width:76px}
  .tpe-slider{grid-template-columns:84px 1fr 34px}
}
/* Edit buttons on photos waiting to be posted */
.tf-file{position:relative}
#ttc-feed-app .tf-file-edit{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 10px;border-radius:14px;border:1px solid #23363D;background:#15242A;color:#3FD2E8!important;font:700 12px Inter,sans-serif;cursor:pointer;flex:none}
.tf-file-edit .tf-ic{width:14px;height:14px}
#ttc-feed-app .tph-pthumb .tph-pedit{right:auto;left:4px}
