/* ===== OWN COPY of the shared theme.css + tool.css rules this tool uses (rule 171, separation plan P3, 2026-10-25) =====
   Copied from theme  by devkit/sep.js (rules that match this box in every state + the class names its own scripts add),
   every selector scoped to :where(#th-tool[data-module="photo-editor"] *). The shared files no longer reach inside this box (data-own).
   Change these rules only for THIS tool, in its own chat. ===== */
/* theme.css copy */
:root:where(#th-tool[data-module="photo-editor"] *){
  --bg:#FAFAFC; --surface:#FFFFFF; --surface-2:#F2F3F8; --ink:#0B1020; --muted:#5B6275; --line:#E4E6EE;
  --brand:#4338CA; --brand-2:#4F46E5; --brand-ink:#3730A3; --brand-soft:#EEF0FF; --on-brand:#FFFFFF;
  --ai:#7C3AED; --ai-ink:#6D28D9; --ai-soft:#F4EFFF; --blue:#2563EB;
  --grad:linear-gradient(135deg,#2563EB 0%,#4F46E5 45%,#7C3AED 100%);
  --warn:#9A4A07; --ok:#1B6B3A;
  --shadow:0 1px 2px rgba(11,16,32,.04),0 4px 16px rgba(11,16,32,.05);
  --shadow-lg:0 2px 4px rgba(11,16,32,.04),0 24px 60px rgba(11,16,32,.10);
  --radius:16px; --radius-sm:10px;
  --font:'Geist','Geist Variable',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;
  --serif:'Instrument Serif',ui-serif,Georgia,serif;
  --mono:'Geist Mono','Geist Mono Variable',ui-monospace,SFMono-Regular,Menlo,monospace;
  --dot:rgba(11,16,32,.06); --glow-a:rgba(37,99,235,.14); --glow-b:rgba(124,58,237,.14);
  --stripe:rgba(11,16,32,.035);
  color-scheme:light;
}
:root[data-theme="dark"]:where(#th-tool[data-module="photo-editor"] *){
  --bg:#07090F; --surface:#0E121B; --surface-2:#161B27; --ink:#EEF0F6; --muted:#9AA3B8; --line:#212738;
  --brand:#6366F1; --brand-2:#4F46E5; --brand-ink:#A5B4FC; --brand-soft:#171A36; --on-brand:#FFFFFF;
  --ai:#8B5CF6; --ai-ink:#C4B5FD; --ai-soft:#1C1733; --blue:#60A5FA;
  --grad:linear-gradient(135deg,#60A5FA 0%,#818CF8 45%,#C084FC 100%);
  --shadow:0 1px 0 rgba(255,255,255,.03) inset,0 1px 2px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:0 1px 0 rgba(255,255,255,.04) inset,0 24px 60px rgba(0,0,0,.55);
  --dot:rgba(255,255,255,.045); --glow-a:rgba(59,130,246,.22); --glow-b:rgba(139,92,246,.24);
  --stripe:rgba(255,255,255,.035);
  color-scheme:dark;
}@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]):where(#th-tool[data-module="photo-editor"] *){
  --bg:#07090F; --surface:#0E121B; --surface-2:#161B27; --ink:#EEF0F6; --muted:#9AA3B8; --line:#212738;
  --brand:#6366F1; --brand-2:#4F46E5; --brand-ink:#A5B4FC; --brand-soft:#171A36; --on-brand:#FFFFFF;
  --ai:#8B5CF6; --ai-ink:#C4B5FD; --ai-soft:#1C1733; --blue:#60A5FA;
  --grad:linear-gradient(135deg,#60A5FA 0%,#818CF8 45%,#C084FC 100%);
  --shadow:0 1px 0 rgba(255,255,255,.03) inset,0 1px 2px rgba(0,0,0,.5),0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:0 1px 0 rgba(255,255,255,.04) inset,0 24px 60px rgba(0,0,0,.55);
  --dot:rgba(255,255,255,.045); --glow-a:rgba(59,130,246,.22); --glow-b:rgba(139,92,246,.24);
  --stripe:rgba(255,255,255,.035);
  color-scheme:dark;
  }}
:root:where(#th-tool[data-module="photo-editor"] *){
  /* spacing scale (4 px steps) */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-7:32px; --sp-8:40px;
  /* what the spacing is for */
  --gap-label:6px;      /* label → its box, box → its hint line */
  --gap-msg:12px;       /* v1.40: a box → the message or hint under it — the smallest space between two different things */
  --gap-min:8px;        /* v1.40: the absolute minimum between any two boxes, buttons or messages (the spacing check fails below it) */
  --gap-item:12px;      /* items in a list, choice cards in a box */
  --gap-grid:16px;      /* boxes/cards side by side */
  --gap-block:20px;     /* blocks inside one part of a tool (input → result → check) */
  --gap-section:22px;   /* main parts of a tool card */
  --sec-pad:26px;       /* space above a new part that starts with a divider line */
  --pad-box:16px;       /* inside a bordered box */
  --pad-card:12px 14px; /* inside a small choice card */
  --pad-result:24px 26px; /* inside the big result panel */
  --r-box:16px; --r-card:12px; --r-btn:12px; --r-pill:999px;
  --tap:44px;           /* smallest thing a finger has to hit */
  --h-btn:44px;         /* v1.39.1 THE button height (owner rule: every normal button is this tall — never set a custom height) */
  --h-btn-sm:36px;      /* small buttons in tool toolbars (.btn.sm) */
  --pad-field:14px 16px; /* inside every text box and output panel: text never touches a border */
  /* type scale = the Word Counter / Case Converter / KM to Miles standard; never bigger */
  --fs-meta:12.5px;     /* counts, small notes */
  --fs-label:13px;      /* field labels, box titles, hints */
  --fs-sm:14px;         /* checklist lines, choice text */
  --fs-body:15px;       /* sentences, buttons, part titles */
  --fs-input:20px;      /* the main text box */
  --fs-slug:22px;       /* one-line mono result */
  --fs-result:clamp(30px,3vw,36px); /* big number result (v1.37: was up to 48 px — owner: too big) */
  /* v1.37 ToolHa type standard (owner 2026-09-30): nothing bigger than these, no text smaller than --fs-min */
  --fs-hero:clamp(36px,5vw,60px);  /* ONE big hero title per landing page (home, All tools, A–Z, company pages) */
  --fs-h1:clamp(30px,3.4vw,42px);  /* page / tool title */
  --fs-h2:clamp(22px,2.2vw,28px);  /* section titles */
  --fs-h3:clamp(17px,1.5vw,19px);  /* v1.41.3: a smaller title for an optional part inside a tool (between --fs-h2 and a box title) */
  --fs-min:12.5px;                 /* smallest normal text (notes, units, counts) */
  --fs-tag:12px;                   /* only UPPERCASE labels, badges and number pins */
  --lh-tight:1.35; --lh-text:1.5;
}@media (width <= 768px){
:root:where(#th-tool[data-module="photo-editor"] *){--pad-field:12px 14px;--gap-grid:14px;--gap-block:16px;--gap-section:18px;--sec-pad:22px;--pad-box:14px;--pad-result:20px;--fs-slug:19px}}
*:where(#th-tool[data-module="photo-editor"] *){box-sizing:border-box}
html:where(#th-tool[data-module="photo-editor"] *){-webkit-text-size-adjust:100%}
body:where(#th-tool[data-module="photo-editor"] *){margin:0;font-family:var(--font);background:var(--bg);color:var(--ink);font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased}
a:where(#th-tool[data-module="photo-editor"] *){color:var(--brand-ink);text-decoration:none}
a:hover:where(#th-tool[data-module="photo-editor"] *){text-decoration:underline;text-underline-offset:3px}
h1:where(#th-tool[data-module="photo-editor"] *),h2:where(#th-tool[data-module="photo-editor"] *),h3:where(#th-tool[data-module="photo-editor"] *){line-height:1.1;letter-spacing:-.02em;margin:0}
p:where(#th-tool[data-module="photo-editor"] *){margin:0}
button:where(#th-tool[data-module="photo-editor"] *),input:where(#th-tool[data-module="photo-editor"] *),select:where(#th-tool[data-module="photo-editor"] *),textarea:where(#th-tool[data-module="photo-editor"] *){font:inherit;color:inherit}
:focus-visible:where(#th-tool[data-module="photo-editor"] *){outline:3px solid color-mix(in srgb,var(--ai) 55%,transparent);outline-offset:2px;border-radius:6px}
.sr:where(#th-tool[data-module="photo-editor"] *){position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.wrap:where(#th-tool[data-module="photo-editor"] *){max-width:1280px;margin:0 auto;padding:0 32px}
.btn:where(#th-tool[data-module="photo-editor"] *){height:var(--h-btn);padding:0 18px;border-radius:12px;border:1px solid transparent;display:inline-flex;align-items:center;gap:8px;font-weight:650;cursor:pointer;font-size:15px}
:root:where(#th-tool[data-module="photo-editor"] *){
  --btn-grad:linear-gradient(120deg,var(--brand-2) 0%,var(--ai) 100%);
  /* v1.35 main typing box (see tool.css "v1.35"): same height as the homepage search box (76 px, 72 px on phones) */
  --h-main:76px;--r-main:20px;
  --field-ring:linear-gradient(120deg,var(--brand-2) 0%,var(--ai) 100%);
  --field-glow:0 6px 22px -10px color-mix(in srgb,var(--ai) 45%,transparent);
  --field-glow-hover:0 8px 28px -10px color-mix(in srgb,var(--ai) 60%,transparent);
  --btn-grad-hover:linear-gradient(120deg,color-mix(in srgb,var(--brand-2) 40%,var(--ai)) 0%,color-mix(in srgb,var(--ai) 88%,#fff) 100%);
  --btn-glow:0 6px 18px -9px color-mix(in srgb,var(--ai) 60%,transparent);
  --btn-glow-hover:0 10px 26px -9px color-mix(in srgb,var(--ai) 85%,transparent);
  --btn-glow-press:0 3px 10px -6px color-mix(in srgb,var(--ai) 70%,transparent);
  --btn2-border:color-mix(in srgb,var(--brand) 24%,var(--line));
  --btn2-border-hover:color-mix(in srgb,var(--brand) 55%,var(--line));
  --btn2-bg-hover:color-mix(in srgb,var(--brand) 5%,var(--surface));
  --btn2-shade:0 8px 20px -12px color-mix(in srgb,var(--brand) 60%,transparent);
}
.btn:where(#th-tool[data-module="photo-editor"] *){transition:border-color .3s ease,background-color .3s ease,box-shadow .3s ease,color .2s ease}
.btn-brand:where(#th-tool[data-module="photo-editor"] *){position:relative;isolation:isolate;border-color:transparent;color:#fff;background:var(--btn-grad) border-box;box-shadow:var(--btn-glow);filter:none}
.btn-brand:where(#th-tool[data-module="photo-editor"] *)::before{content:"";position:absolute;inset:-1px;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--btn-grad-hover);opacity:0;transition:opacity .35s ease}
.btn-brand:hover:where(#th-tool[data-module="photo-editor"] *){text-decoration:none;filter:none;box-shadow:var(--btn-glow-hover)}
.btn-brand:hover:where(#th-tool[data-module="photo-editor"] *)::before{opacity:1}
.btn-brand:active:where(#th-tool[data-module="photo-editor"] *){box-shadow:var(--btn-glow-press)}
.btn-ghost:where(#th-tool[data-module="photo-editor"] *){background:var(--surface);border-color:var(--btn2-border);color:var(--ink);box-shadow:0 1px 2px rgba(11,16,32,.04)}
.btn-ghost:hover:where(#th-tool[data-module="photo-editor"] *){text-decoration:none;background:var(--btn2-bg-hover);border-color:var(--btn2-border-hover);box-shadow:var(--btn2-shade)}
.btn[disabled]:where(#th-tool[data-module="photo-editor"] *)::before{display:none}@media (prefers-reduced-motion:reduce){
.btn:where(#th-tool[data-module="photo-editor"] *),.btn:where(#th-tool[data-module="photo-editor"] *)::before{transition:none}}
.chip:where(#th-tool[data-module="photo-editor"] *){display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-size:14px;font-weight:550;white-space:nowrap}
.chip:hover:where(#th-tool[data-module="photo-editor"] *){border-color:color-mix(in srgb,var(--brand) 45%,var(--line));text-decoration:none}
body:has(>.hdr):where(#th-tool[data-module="photo-editor"] *)::before{content:"";position:absolute;left:0;right:0;top:0;height:760px;z-index:-1;pointer-events:none;background-image:linear-gradient(var(--dot) 1px,transparent 1px),linear-gradient(90deg,var(--dot) 1px,transparent 1px);background-size:56px 56px;background-position:50% -1px;-webkit-mask-image:radial-gradient(ellipse 75% 100% at 50% 0%,#000 35%,transparent 80%);mask-image:radial-gradient(ellipse 75% 100% at 50% 0%,#000 35%,transparent 80%)}@media (width <= 768px){
body:has(>.hdr):where(#th-tool[data-module="photo-editor"] *)::before{height:560px;-webkit-mask-image:linear-gradient(#000 45%,transparent);mask-image:linear-gradient(#000 45%,transparent)}}@media print{
body:where(#th-tool[data-module="photo-editor"] *)::before{display:none!important;content:none!important}}
.card:where(#th-tool[data-module="photo-editor"] *){background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.inp:where(#th-tool[data-module="photo-editor"] *){height:46px;border:1px solid var(--line);border-radius:12px;padding:0 14px;background:var(--surface);font-size:16px;width:100%}
textarea.inp:where(#th-tool[data-module="photo-editor"] *){height:auto;padding:var(--pad-field);line-height:var(--lh-text)}
.inp:focus:where(#th-tool[data-module="photo-editor"] *){outline:none;border-color:var(--ai);box-shadow:0 0 0 4px color-mix(in srgb,var(--ai) 18%,transparent)}
select.inp:where(#th-tool[data-module="photo-editor"] *){appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 18px) 20px,calc(100% - 13px) 20px;background-size:5px 5px;background-repeat:no-repeat;padding-right:36px}@media (width <= 1024px){
.wrap:where(#th-tool[data-module="photo-editor"] *){padding:0 18px}}@media (width <= 768px){
body:where(#th-tool[data-module="photo-editor"] *){padding-bottom:68px}}@media (width <= 576px){
:root:where(#th-tool[data-module="photo-editor"] *){--h-main:72px}}
.chip:where(#th-tool[data-module="photo-editor"] *){white-space:nowrap}
[hidden]:where(#th-tool[data-module="photo-editor"] *){display:none!important}
:root:where(#th-tool[data-module="photo-editor"] *){--acc0:#7C3AED;--acc1:#2563EB;--acc2:#0D9488;--acc3:#D97706;--acc4:#DB2777;--acc5:#059669}
:root[data-theme="dark"]:where(#th-tool[data-module="photo-editor"] *){--acc0:#8B5CF6;--acc1:#60A5FA;--acc2:#2DD4BF;--acc3:#FBBF24;--acc4:#F472B6;--acc5:#34D399}@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]):where(#th-tool[data-module="photo-editor"] *){--acc0:#8B5CF6;--acc1:#60A5FA;--acc2:#2DD4BF;--acc3:#FBBF24;--acc4:#F472B6;--acc5:#34D399}}
small:where(#th-tool[data-module="photo-editor"] *){font-size:max(var(--fs-min),.85em)}
.btn:not(.tool-actions .btn):where(#th-tool[data-module="photo-editor"] *){height:auto!important;min-height:var(--h-btn);padding-top:8px;padding-bottom:8px;line-height:1.25}
.btn.sm:not(.tool-actions .btn):where(#th-tool[data-module="photo-editor"] *){height:auto!important;min-height:var(--h-btn-sm);padding-top:6px;padding-bottom:6px}
html:where(#th-tool[data-module="photo-editor"] *),body:where(#th-tool[data-module="photo-editor"] *){overflow-x:clip}@supports (appearance:base-select){
html select:not([multiple]):not([size]):where(#th-tool[data-module="photo-editor"] *),html select:not([multiple]):not([size]):where(#th-tool[data-module="photo-editor"] *)::picker(select){appearance:base-select}
html select:not([multiple]):not([size]):where(#th-tool[data-module="photo-editor"] *){align-items:center}
html select:not([multiple]):not([size]):where(#th-tool[data-module="photo-editor"] *)::picker-icon{display:none}
html select:not([multiple]):not([size]):where(#th-tool[data-module="photo-editor"] *)::picker(select){
    box-sizing:border-box;min-inline-size:anchor-size(self-inline);
    max-inline-size:min(calc(100% - 16px),max(anchor-size(self-inline),20rem));
    max-block-size:min(24rem,calc(100dvh - 16px));overflow:auto;overscroll-behavior:contain;
    position-area:var(--th-pick-area,block-end span-all);justify-self:anchor-center;margin:4px 8px;padding:4px;border:1px solid var(--line);border-radius:12px;
    background:var(--surface);color:var(--ink);box-shadow:0 12px 32px rgba(15,23,42,.18);
    position-try-order:normal;position-try-fallbacks:flip-block,--th-pick-fit}
html select:not([multiple]):not([size]) option:where(#th-tool[data-module="photo-editor"] *){
    padding:8px 10px;border-radius:8px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;gap:8px;min-block-size:36px}
html select:not([multiple]):not([size]) option:is(:hover,:focus-visible):where(#th-tool[data-module="photo-editor"] *){background:color-mix(in srgb,var(--brand) 10%,transparent);outline:none}
html select:not([multiple]):not([size]) option:checked:where(#th-tool[data-module="photo-editor"] *){background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand-ink);font-weight:600}
html select:not([multiple]):not([size]) option:disabled:where(#th-tool[data-module="photo-editor"] *){opacity:.5}
html select:not([multiple]):not([size]) optgroup:where(#th-tool[data-module="photo-editor"] *){font-weight:700;padding-block:4px}
html select:not([multiple]):not([size]) option:where(#th-tool[data-module="photo-editor"] *)::checkmark{color:var(--brand-ink)}}
/* tool.css copy */
:root:where(#th-tool[data-module="photo-editor"] *){--h-drop:17.5rem}
.t-drop:where(#th-tool[data-module="photo-editor"] *){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gap-item);min-height:var(--h-drop);padding:var(--pad-result);border:2px dashed color-mix(in srgb,var(--brand) 45%,var(--line));border-radius:var(--r-card);background:color-mix(in srgb,var(--brand) 4%,var(--surface));text-align:center;cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}
.t-drop[hidden]:where(#th-tool[data-module="photo-editor"] *){display:none}
.t-drop:hover:where(#th-tool[data-module="photo-editor"] *),.t-drop.is-drag:where(#th-tool[data-module="photo-editor"] *){border-color:var(--brand);border-style:solid;background:color-mix(in srgb,var(--brand) 10%,var(--surface))}
.t-drop:focus-visible:where(#th-tool[data-module="photo-editor"] *){outline:none;border-color:var(--brand);border-style:solid;box-shadow:var(--field-glow-hover)}
.t-drop-i:where(#th-tool[data-module="photo-editor"] *){transition:transform .2s ease}
.t-drop:hover .t-drop-i:where(#th-tool[data-module="photo-editor"] *),.t-drop.is-drag .t-drop-i:where(#th-tool[data-module="photo-editor"] *){transform:translateY(-3px) scale(1.03)}@media (prefers-reduced-motion:reduce){
.t-drop-i:where(#th-tool[data-module="photo-editor"] *){transition:none}
.t-drop:hover .t-drop-i:where(#th-tool[data-module="photo-editor"] *),.t-drop.is-drag .t-drop-i:where(#th-tool[data-module="photo-editor"] *){transform:none}}
.tool:where(#th-tool[data-module="photo-editor"] *){padding:24px;display:flex;flex-direction:column;gap:18px;position:relative;border-radius:24px}
.tool:where(#th-tool[data-module="photo-editor"] *)::before{content:"";position:absolute;inset:-1px;border-radius:25px;padding:1px;background:linear-gradient(135deg,color-mix(in srgb,var(--brand) 55%,transparent),transparent 35%,transparent 65%,color-mix(in srgb,var(--ai) 55%,transparent));-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}@media (width <= 1024px){
.tool:where(#th-tool[data-module="photo-editor"] *){padding:16px}}
.tool-zone:where(#th-tool[data-module="photo-editor"] *){padding-bottom:8px}
.tool:where(#th-tool[data-module="photo-editor"] *){padding:22px 24px 20px;gap:16px}
.chip[aria-pressed="true"]:where(#th-tool[data-module="photo-editor"] *){background:var(--ink);color:var(--bg);border-color:var(--ink)}
.inp.sm:where(#th-tool[data-module="photo-editor"] *){height:36px;font-size:14px;padding:0 34px 0 12px;width:auto;border-radius:10px;background-position:calc(100% - 16px) 16px,calc(100% - 11px) 16px}
.btn.sm:where(#th-tool[data-module="photo-editor"] *){height:var(--h-btn-sm);padding:0 12px;font-size:14px;border-radius:10px}
.linkish:where(#th-tool[data-module="photo-editor"] *){background:none;border:0;color:var(--muted);cursor:pointer;font-size:13px;text-decoration:underline;text-underline-offset:3px;padding:0}
#th-tool .t-fullrow:where(#th-tool[data-module="photo-editor"] *){grid-column:1/-1!important;flex:1 1 100%!important;max-width:100%!important;min-width:0}
#th-tool .t-selw:where(#th-tool[data-module="photo-editor"] *){display:contents}
#th-tool .t-selw.on:where(#th-tool[data-module="photo-editor"] *){display:grid;min-width:0;max-width:100%}
#th-tool .t-selw.on>select:where(#th-tool[data-module="photo-editor"] *){grid-area:1/1;width:100%!important;max-width:100%!important;height:auto!important;color:transparent!important;-webkit-text-fill-color:transparent;text-shadow:none}
#th-tool .t-selw.on>select option:where(#th-tool[data-module="photo-editor"] *){color:var(--ink);-webkit-text-fill-color:var(--ink)}
#th-tool .t-selt:where(#th-tool[data-module="photo-editor"] *){display:none}
#th-tool .t-selw.on>.t-selt:where(#th-tool[data-module="photo-editor"] *){display:block;grid-area:1/1;align-self:center;min-width:0;pointer-events:none;white-space:normal;overflow-wrap:anywhere;text-align:start;z-index:1}
#th-tool .t-fullrow select:where(#th-tool[data-module="photo-editor"] *),#th-tool select.t-fullrow:where(#th-tool[data-module="photo-editor"] *){width:100%;max-width:100%}
#th-tool:where(#th-tool[data-module="photo-editor"] *){overflow-wrap:break-word}
#th-tool .chip:where(#th-tool[data-module="photo-editor"] *){white-space:normal;overflow-wrap:anywhere}@media (width <= 576px){
.tool:where(#th-tool[data-module="photo-editor"] *){padding:16px}}
.tool-hero:where(#th-tool[data-module="photo-editor"] *){position:relative;overflow-x:clip;padding-bottom:30px}
.tool-hero:where(#th-tool[data-module="photo-editor"] *)::after{content:"";position:absolute;left:50%;top:120px;width:900px;max-width:100%;height:360px;transform:translateX(-50%);background:radial-gradient(closest-side at 35% 50%,var(--glow-a),transparent 70%),radial-gradient(closest-side at 65% 50%,var(--glow-b),transparent 70%);filter:blur(24px);opacity:.8;pointer-events:none}
.tool-hero>.wrap:where(#th-tool[data-module="photo-editor"] *){position:relative;z-index:1}
.tool-zone .tool:where(#th-tool[data-module="photo-editor"] *){max-width:1040px;margin:0 auto;background:var(--surface);box-shadow:var(--shadow-lg)}
.tool-zone .tool:where(#th-tool[data-module="photo-editor"] *){transition:box-shadow .25s}
.tool-zone .tool:focus-within:where(#th-tool[data-module="photo-editor"] *){box-shadow:var(--shadow-lg),0 0 0 4px color-mix(in srgb,var(--brand) 14%,transparent)}
.uc-dir:where(#th-tool[data-module="photo-editor"] *){display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);align-self:center;max-width:100%;overflow-x:auto;scrollbar-width:none}
.uc-dir button:where(#th-tool[data-module="photo-editor"] *){border:0;background:transparent;color:var(--muted);font-weight:650;font-size:14px;padding:8px 16px;border-radius:999px;cursor:pointer;white-space:nowrap;display:inline-flex;gap:6px;align-items:center;transition:.18s}
.uc-dir button:hover:where(#th-tool[data-module="photo-editor"] *){color:var(--ink)}
.uc-dir button[aria-pressed="true"]:where(#th-tool[data-module="photo-editor"] *){background:var(--grad);color:#fff;box-shadow:0 6px 18px color-mix(in srgb,var(--brand) 35%,transparent)}@container tool (width <= 22.5rem){
.uc-dir button:where(#th-tool[data-module="photo-editor"] *){padding:8px 12px;font-size:13px}}@media print{
html:root:where(#th-tool[data-module="photo-editor"] *),html:root[data-theme="dark"]:where(#th-tool[data-module="photo-editor"] *),html:root:not([data-theme="light"]):where(#th-tool[data-module="photo-editor"] *){--bg:#fff;--surface:#fff;--surface-2:#F3F4F6;--ink:#111;--muted:#4B5563;--line:#D1D5DB;--brand-soft:#EEF0FF;--brand-ink:#3730A3;color-scheme:light}
body:where(#th-tool[data-module="photo-editor"] *){background:#fff!important;color:#111}
dialog:where(#th-tool[data-module="photo-editor"] *){display:none!important}
.tool-hero:where(#th-tool[data-module="photo-editor"] *){background:none!important;padding:0!important}
.tool:where(#th-tool[data-module="photo-editor"] *){box-shadow:none!important;border:1px solid #D1D5DB!important;break-inside:auto}
.tool :is(tr,li,figure,img,svg,canvas,.t-msg,.t-btnrow,.uc-thermo):where(#th-tool[data-module="photo-editor"] *){break-inside:avoid}
.tool :is(h2,h3,h4,legend,summary,label,thead,.t-bx-h,.t-sec-h):where(#th-tool[data-module="photo-editor"] *){break-after:avoid}
body:where(#th-tool[data-module="photo-editor"] *){padding-bottom:0!important}
.tool-zone:where(#th-tool[data-module="photo-editor"] *){padding-bottom:0!important}
.tool .btn:where(#th-tool[data-module="photo-editor"] *),.uc-dir:where(#th-tool[data-module="photo-editor"] *){display:none!important}
details:not([open])>*:not(summary):where(#th-tool[data-module="photo-editor"] *){display:none}
a:where(#th-tool[data-module="photo-editor"] *){color:inherit;text-decoration:none}}@media print{
.tool:where(#th-tool[data-module="photo-editor"] *)::before,.tool:where(#th-tool[data-module="photo-editor"] *)::after,.tool-hero:where(#th-tool[data-module="photo-editor"] *)::after{display:none!important;content:none!important}}
.t-stack:not([hidden]):where(#th-tool[data-module="photo-editor"] *){display:flex;flex-direction:column;gap:var(--gap-block)}
.t-box:where(#th-tool[data-module="photo-editor"] *){margin:0;min-width:0;border:1px solid var(--line);border-radius:var(--r-box);padding:var(--pad-box);background:var(--surface);display:flex;flex-direction:column;gap:var(--gap-item)}
.t-box>legend:where(#th-tool[data-module="photo-editor"] *){float:left;width:100%;padding:0;margin:0 0 var(--gap-item);font-size:var(--fs-label);font-weight:650;color:var(--ink)}
.t-choices:where(#th-tool[data-module="photo-editor"] *){clear:both;display:flex;flex-direction:column;gap:var(--gap-item)}
.t-choice:where(#th-tool[data-module="photo-editor"] *){display:flex;align-items:flex-start;gap:var(--sp-3);min-height:var(--tap);padding:var(--pad-card);border:1.5px solid var(--line);border-radius:var(--r-card);background:var(--surface-2);cursor:pointer;font-size:var(--fs-sm);line-height:var(--lh-tight);transition:border-color .15s,background-color .15s}
.t-choice:hover:where(#th-tool[data-module="photo-editor"] *){border-color:color-mix(in srgb,var(--brand) 45%,var(--line))}
.t-choice:has(input:checked):where(#th-tool[data-module="photo-editor"] *){border-color:var(--brand);background:color-mix(in srgb,var(--brand) 9%,var(--surface))}
.t-choice>input:where(#th-tool[data-module="photo-editor"] *){flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--brand)}
.t-msg:where(#th-tool[data-module="photo-editor"] *){margin:0;padding:10px 14px;border-radius:var(--r-card);font-size:var(--fs-sm);font-weight:600;line-height:var(--lh-text);color:var(--warn);background:color-mix(in srgb,var(--warn) 9%,var(--surface));border:1px solid color-mix(in srgb,var(--warn) 30%,var(--line))}
.t-msg.is-err:where(#th-tool[data-module="photo-editor"] *){color:var(--bad,#c0392b);background:color-mix(in srgb,var(--bad,#c0392b) 8%,var(--surface));border-color:color-mix(in srgb,var(--bad,#c0392b) 30%,var(--line))}
.t-msg.is-ok:where(#th-tool[data-module="photo-editor"] *){color:var(--ok,#1e8e5a);background:color-mix(in srgb,var(--ok,#1e8e5a) 8%,var(--surface));border-color:color-mix(in srgb,var(--ok,#1e8e5a) 30%,var(--line))}
.t-msg.is-info:where(#th-tool[data-module="photo-editor"] *){color:var(--ink);background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand) 25%,var(--line))}
.t-msg[hidden]:where(#th-tool[data-module="photo-editor"] *){display:none}
:root[data-theme="dark"] .t-msg:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--warn) 40%,#fff)}
:root[data-theme="dark"] .t-msg.is-err:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--bad,#c0392b) 45%,#fff)}
:root[data-theme="dark"] .t-msg.is-ok:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--ok,#1e8e5a) 40%,#fff)}
:root[data-theme="dark"] .t-msg.is-info:where(#th-tool[data-module="photo-editor"] *){color:var(--ink)}@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]) .t-msg:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--warn) 40%,#fff)}
:root:not([data-theme="light"]) .t-msg.is-err:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--bad,#c0392b) 45%,#fff)}
:root:not([data-theme="light"]) .t-msg.is-ok:where(#th-tool[data-module="photo-editor"] *){color:color-mix(in srgb,var(--ok,#1e8e5a) 40%,#fff)}
:root:not([data-theme="light"]) .t-msg.is-info:where(#th-tool[data-module="photo-editor"] *){color:var(--ink)}}
.tool :is(input,textarea):where(#th-tool[data-module="photo-editor"] *)::placeholder{color:color-mix(in srgb,var(--muted) 70%,transparent);opacity:1;font-weight:400;font-size:max(12px,.875em);letter-spacing:0}
:root:where(#th-tool[data-module="photo-editor"] *){--glow-card:0 16px 36px -20px color-mix(in srgb,var(--ai) 50%,transparent),0 1px 2px rgba(11,16,32,.04)}
.ag-i:where(#th-tool[data-module="photo-editor"] *){flex:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border-radius:50%;border:1px solid color-mix(in srgb,var(--brand) 35%,var(--line));background:var(--brand-soft);color:var(--brand-ink);font:italic 700 13px/1 Georgia,serif;cursor:help}
.ag-i:hover:where(#th-tool[data-module="photo-editor"] *),.ag-i[aria-expanded="true"]:where(#th-tool[data-module="photo-editor"] *){background:var(--brand);border-color:var(--brand);color:#fff}
.ag-i:focus-visible:where(#th-tool[data-module="photo-editor"] *){outline:2px solid var(--ai);outline-offset:2px}
.ag-tip:where(#th-tool[data-module="photo-editor"] *){margin:8px 0 0;padding:10px 12px;border-radius:12px;background:var(--brand-soft);font-size:var(--fs-label);line-height:var(--lh-text);color:var(--ink)}
.ag-tip[hidden]:where(#th-tool[data-module="photo-editor"] *){display:none}
.ag-how>summary:where(#th-tool[data-module="photo-editor"] *){list-style:none;display:flex;align-items:center;gap:10px;width:100%;min-height:var(--tap);cursor:pointer;border-radius:10px;font-size:var(--fs-sm);font-weight:650;color:var(--ink)}
.ag-how>summary:where(#th-tool[data-module="photo-editor"] *)::-webkit-details-marker{display:none}
.ag-sum-w:where(#th-tool[data-module="photo-editor"] *){display:inline-flex;align-items:center;gap:10px}
.ag-how>summary:hover .ag-sum-t:where(#th-tool[data-module="photo-editor"] *){color:var(--brand-ink);text-decoration:underline;text-underline-offset:3px}
.ag-how>summary:hover .ag-i:where(#th-tool[data-module="photo-editor"] *),.ag-how[open]>summary .ag-i:where(#th-tool[data-module="photo-editor"] *){background:var(--brand);border-color:var(--brand);color:#fff}
.ag-how>summary:focus-visible:where(#th-tool[data-module="photo-editor"] *){outline:2px solid var(--ai);outline-offset:2px}
.ag-how .ag-howt:where(#th-tool[data-module="photo-editor"] *){margin-top:var(--gap-label);padding:var(--pad-field);border-radius:var(--r-card);background:var(--surface-2)}
.ag-howt:where(#th-tool[data-module="photo-editor"] *){margin-top:10px;display:grid;gap:8px;font-size:var(--fs-sm);line-height:var(--lh-text);color:var(--ink)}
.ag-howt p:where(#th-tool[data-module="photo-editor"] *){margin:0}@media print{
.ag-i:where(#th-tool[data-module="photo-editor"] *){display:none!important}}
:where(.tool) :is(input,select,textarea):where(#th-tool[data-module="photo-editor"] *){max-width:100%}
.tool .chip:where(#th-tool[data-module="photo-editor"] *){max-width:100%}@container tool (width <= 22.5rem){
:where(.tool) .uc-dir:where(:not(:has(>:nth-child(4))))>button:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto;min-width:0;white-space:normal;flex-wrap:wrap;row-gap:0;justify-content:center;text-align:center}}@container tool (width <= 22.5rem){
:where(.tool) .uc-dir:where(:not(:has(>:nth-child(4))))>button:has(>span)>svg:where(#th-tool[data-module="photo-editor"] *){display:none}}@container tool (width <= 22.5rem){
select.inp:where(#th-tool[data-module="photo-editor"] *){padding-right:26px;background-position:calc(100% - 13px) 20px,calc(100% - 8px) 20px}
select.inp.sm:where(#th-tool[data-module="photo-editor"] *){padding-right:28px;background-position:calc(100% - 14px) 16px,calc(100% - 9px) 16px}}@container tool (width <= 22.5rem){
select.inp:where(:not(.sm)):where(#th-tool[data-module="photo-editor"] *){padding-left:10px;padding-right:24px}}
#th-tool .t-btnrow:where(#th-tool[data-module="photo-editor"] *){display:flex;flex-wrap:nowrap;align-items:stretch;gap:8px;margin:0}
#th-tool .t-btnrow>.btn:where(#th-tool[data-module="photo-editor"] *){flex:1 1 auto;min-width:min-content;justify-content:center;text-align:center;white-space:normal}
#th-tool .t-btnrow>label.btn:where(#th-tool[data-module="photo-editor"] *){font-size:14px;font-weight:650;color:var(--ink)}@container tool (width > 36rem){
#th-tool .t-btnrow.t-btnrow-nat>.btn:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto}}@container tool (width <= 22.5rem){
#th-tool .t-btnrow>.btn.sm:where(#th-tool[data-module="photo-editor"] *){padding-left:8px;padding-right:8px;gap:6px}}
#th-tool .t-btnrow:has(>.btn~.btn):not(:has(>.btn~.btn~.btn)):where(#th-tool[data-module="photo-editor"] *){flex-wrap:wrap}
#th-tool .t-btnrow:has(>.btn~.btn):not(:has(>.btn~.btn~.btn))>.btn:where(#th-tool[data-module="photo-editor"] *){flex:1 1 max-content;max-width:none}@container tool (width > 36rem){
#th-tool .t-btnrow.t-btnrow-nat:has(>.btn~.btn):not(:has(>.btn~.btn~.btn))>.btn:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto}}
#th-tool .t-btnrow:has(>.btn~.btn~.btn):where(#th-tool[data-module="photo-editor"] *){flex-wrap:wrap}
#th-tool .t-btnrow:has(>.btn~.btn~.btn)>.btn:where(#th-tool[data-module="photo-editor"] *){flex:1 1 0px;max-width:none;min-width:min(100%,max(0px,calc((480px - 100%) * 999)))}
#th-tool .t-btnrow:has(>.btn~.btn~.btn~.btn~.btn)>.btn:where(#th-tool[data-module="photo-editor"] *){min-width:min(100%,max(0px,calc((600px - 100%) * 999)))}@container tool (width > 36rem){
#th-tool .t-btnrow.t-btnrow-nat:has(>.btn~.btn~.btn)>.btn:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto}}
#th-tool .t-btnrow:has(>.btn~.btn~.btn~.btn):not(:has(>.btn~.btn~.btn~.btn~.btn))>.btn:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto;min-width:min(calc(50% - 4px),max(0px,calc((600px - 100%) * 999)));max-width:max(calc(50% - 4px),calc((100% - 600px) * 999))}
#th-tool .t-btnrow.t-stack>.btn:where(#th-tool[data-module="photo-editor"] *){flex:1 1 100%!important;max-width:none!important}
#th-tool .t-bal:where(#th-tool[data-module="photo-editor"] *){flex-wrap:wrap!important}
#th-tool .t-bal>.btn:where(#th-tool[data-module="photo-editor"] *){flex:1 1 var(--bal-w)!important;max-width:var(--bal-w)!important;min-width:0!important}
#th-tool .btn.t-noicon>svg:where(#th-tool[data-module="photo-editor"] *){display:none}
#th-tool .btn:not(.sm)>svg:where(#th-tool[data-module="photo-editor"] *){width:18px!important;height:18px!important}
#th-tool .btn>svg:where(#th-tool[data-module="photo-editor"] *){flex:none}
#th-tool .t-btnrow.t-nat:where(#th-tool[data-module="photo-editor"] *){justify-content:center}
#th-tool .t-btnrow.t-nat>.btn:where(#th-tool[data-module="photo-editor"] *){flex:0 1 auto!important;max-width:100%}
#th-tool:where(#th-tool[data-module="photo-editor"] *){container:tool/inline-size}
#th-tool :where(img,video,iframe):where(#th-tool[data-module="photo-editor"] *){max-width:100%}
#th-tool:has(.uc-dir):where(#th-tool[data-module="photo-editor"] *){-webkit-tap-highlight-color:transparent}
#th-tool:has(.uc-dir) .uc-dir button:not([aria-pressed="true"]):active:where(#th-tool[data-module="photo-editor"] *){background:var(--btn2-bg-hover);color:var(--ink)}
/* ===== end of the own copy; the tool's own rules follow ===== */
/* own tooltip (.photoeditor-tip) + toast (.photoeditor-toast): copied from theme.css .th-tt / .toast and renamed (rule 171 (j)) */
.photoeditor-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%) translateY(20px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-size:14px;font-weight:600;opacity:0;transition:.25s;z-index:60;pointer-events:none}
.photoeditor-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.photoeditor-tip{position:fixed;z-index:9999;left:0;top:0;padding:7px 11px;border-radius:10px;background:var(--ink);color:var(--bg);font:500 12.5px/1.45 var(--font,system-ui,sans-serif);box-shadow:0 6px 24px rgba(11,16,32,.22);pointer-events:none;opacity:0;transform:translateY(3px);transition:opacity .12s,transform .12s;white-space:normal;overflow-wrap:anywhere}
.photoeditor-tip.on{opacity:1;transform:none}
.photoeditor-tip::after{content:"";position:absolute;left:var(--ax,50%);bottom:-5px;width:10px;height:10px;margin-left:-5px;background:inherit;transform:rotate(45deg);border-radius:2px}
.photoeditor-tip.below::after{bottom:auto;top:-5px}@media (prefers-reduced-motion:reduce){
.photoeditor-tip{transition:none}}@media print{
.photoeditor-toast{display:none}}
/* ToolHa Photo Editor — the tool's own styles (site tokens and .t-* blocks only; no raw font sizes, no negative margins) */
.pe { display: flex; flex-direction: column; gap: var(--gap-section); }
.pe [hidden] { display: none !important; }

/* ===== start: open a photo or a blank canvas ===== */
.pe-start { display: flex; flex-direction: column; gap: var(--gap-block); }
.pe-q { font-size: var(--fs-h2); line-height: var(--lh-tight); margin: 0; text-align: center; }
.pe-drop { gap: var(--sp-2); padding: var(--sp-6) var(--sp-5); } /* round 75 (owner): a dashed border like HEIC to JPG's drop box, so it reads as "drop here" at a glance (was a solid gradient ring) */
.pe-dropi { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.pe-dropt { font-size: var(--fs-body); color: var(--ink); }
.pe-dropt b { color: var(--brand); }
.pe-drops { font-size: var(--fs-label); color: var(--muted); }
.pe .pe-help { justify-content: center; } /* round 56: the shared .t-btnrow lays the buttons out (rule 93 d); only centred here */
.pe-bt { font-size: var(--fs-h3); margin: 0; line-height: var(--lh-tight); }
.pe-note { font-size: var(--fs-label); color: var(--muted); margin: 0; line-height: var(--lh-text); }
.pe-best { display: inline-block; padding: 1px 7px; border-radius: var(--r-pill); background: #DCFCE7; color: #166534; font-size: var(--fs-tag); font-weight: 700; vertical-align: 1px; text-transform: uppercase; letter-spacing: .02em; }
:root[data-theme="dark"] .pe-best { background: #14532D; color: #BBF7D0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pe-best { background: #14532D; color: #BBF7D0; } }
.pe-draft { display: flex; flex-direction: column; gap: var(--gap-grid); align-items: center; text-align: center; } /* round 64: on a very narrow card the text and buttons go under the picture (rule 151) */
.pe-dimg { flex: none; width: 96px; height: 96px; border-radius: var(--r-card); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pe-dimg img { max-width: 100%; max-height: 100%; display: block; }
.pe-dtx { flex: none; display: flex; flex-direction: column; align-items: center; gap: var(--gap-label); max-width: 100%; min-width: 0; }
.pe-drow { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap-min); padding-top: var(--sp-1); }
.pe-blank { display: flex; flex-direction: column; gap: var(--gap-item); }
.pe-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-item); }
.pe-size { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.pe-size input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pe-shp { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.pe-shp span { display: block; border: 2px solid var(--brand); border-radius: 3px; background: var(--brand-soft); }
.pe-szt { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.pe-szt b { font-size: var(--fs-sm); }
.pe-szt small { font-size: var(--fs-meta); color: var(--muted); }
.pe-size:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); background: var(--brand-soft); }
.pe-size:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-custom, .pe-wh { display: flex; align-items: flex-end; gap: var(--gap-min); font-size: var(--fs-sm); }
.pe-fld { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 0 1 120px; }
.pe-fld .inp { width: 100%; min-width: 0; box-sizing: border-box; }
.pe-x { padding-bottom: var(--sp-3); color: var(--muted); }
.pe-nrow .inp { flex: 1 1 auto; min-width: 0; }
.pe-bgrow, .pe-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-min) var(--sp-3); }
.pe-rl { font-size: var(--fs-label); color: var(--muted); font-weight: 500; margin: 0; }
.pe-newgo { align-self: flex-start; }
.pe-priv { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-label); color: var(--muted); text-align: center; }
.pe-priv svg { flex: 0 0 auto; color: var(--ok); }

/* ===== the editor: a studio (tool rail · the picture · options), modern, light and dark ===== */
.pe { --pe-ws: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); --pe-track: color-mix(in srgb, var(--ink) 14%, transparent);
  --pe-card: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.18); --pe-r: 16px; }
.pe-ed { position: relative; container: pe / inline-size; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: clip; box-shadow: var(--pe-card); }
.pe-top { display: flex; align-items: center; gap: var(--sp-2); padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 60px; box-sizing: border-box; }
.pe-g { display: flex; align-items: center; gap: 4px; }
.pe-right { margin-left: auto; gap: var(--sp-2); }
.pe-phd .pe-pgin { flex: 0 1 220px; min-width: 80px; height: 30px; min-height: 0; padding: 0 8px; box-sizing: border-box; font-size: var(--fs-sm); line-height: 28px; border-radius: 8px; } /* round 21-22: same height as the name, only wider */
.pe-ib { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-body); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pe-ib:hover { background: var(--surface-2); }
.pe-ib[aria-pressed="true"], .pe-ib[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); }
.pe-ib:focus-visible, .pe-zv:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pe-ib:disabled { opacity: .38; cursor: default; background: transparent; }
.pe-ibd:hover { color: #DC2626; }
.pe-top .btn-brand { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.pe-top .btn-ghost { border-color: transparent; font-size: 13.5px; font-weight: 600; } /* round 29 (owner): quiet text buttons in the top bar, only Save stands out */
.pe-top .btn-ghost { white-space: nowrap; } /* round 61: "Start over" never breaks onto two lines; a bar that does not fit beside it moves to the page head */
.pe-selbar.pe-intop .pe-chip2 { flex: 0 0 auto; }
.pe-top .btn-ghost:hover { background: var(--surface-2); }
.pe-l2 { display: none; }

.pe-body { display: grid; grid-template-columns: 84px minmax(0, 1fr) 336px 84px; gap: 12px; padding: 12px; height: clamp(560px, calc(100vh - 76px - var(--pe-top, 0px)), 1400px); height: clamp(560px, calc(100dvh - 76px - var(--pe-top, 0px)), 1400px); box-sizing: border-box; /* owner round 19: the work area fills the screen */
  background-color: var(--pe-ws); } /* round 22 (owner): no dot pattern, the same plain work area everywhere */
/* the tool rail */
.pe-rail { display: flex; flex-direction: column; gap: 0; padding: 5px; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pe-r); box-shadow: var(--pe-card); }
.pe-rail::-webkit-scrollbar { display: none; }
#pe-tiles2 { grid-column: -2; grid-row: 1; } /* round 21 (owner): tools on the right too */
.pe-tile { flex: 0 1 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 0; padding: 3px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; letter-spacing: .015em; line-height: 1.1; cursor: pointer; text-align: center; transition: background-color .15s ease, color .15s ease; }
.pe-tile svg { flex: none; color: inherit; transition: transform .15s ease; }
.pe-topmid { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.pe-selbar.pe-intop { flex: 0 1 auto; max-width: 100%; min-height: 40px; padding: 0 4px; border: 0; box-shadow: none; background: transparent; }
.pe-intop .pe-pgc { display: none; }
.pe-icg { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.pe-icb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.pe-icb:hover, .pe-icb:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.pe-icb img { width: 32px; height: 32px; }
.pe-icn { margin-top: 8px; }
.pe-ring { display: inline-flex; line-height: 0; } /* round 26-27: the border as a ring in its color and style */
.pe-dashg .pe-seg { display: grid; grid-template-columns: repeat(4, 1fr); } /* round 27: 8 border styles, 4 a row */
.pe-dashg .pe-seg button { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 4px; }
.pe-pickc { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pe-pickc svg { width: 18px; height: 18px; }
.pe-phg { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pe-phb { display: block; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.pe-phb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pe-phb:hover, .pe-phb:focus-visible { border-color: var(--brand); outline: 2px solid var(--brand-soft); outline-offset: 0; }
.pe-icl2 { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-label); line-height: 1.6; }
.pe-tile:hover { color: var(--ink); }
.pe-tile:hover svg { color: var(--brand); }
.pe-tile:hover svg { transform: translateY(-1px); }
.pe-tile[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); }
.pe-tile[aria-pressed="true"] svg { color: var(--brand); }
.pe-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* the picture */
.pe-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.pe-stagew { position: relative; flex: 1 1 auto; min-height: 0; border-radius: var(--pe-r); overflow: hidden; touch-action: none; }
#pe-stage { display: block; width: 100%; height: 100%; touch-action: none; outline: none; user-select: none; -webkit-user-select: none; }
#pe-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); border-radius: var(--pe-r); }
.pe-busy { position: absolute; left: 50%; top: var(--sp-4); transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-size: var(--fs-label); box-shadow: var(--shadow); z-index: 2; }
.pe-zpill { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); box-shadow: var(--pe-card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 2; }
.pe-zpill .pe-ib { width: 32px; height: 32px; border-radius: 999px; } /* round 24: a slimmer zoom bar, so the page gets more room */
.pe-cmi[aria-checked="true"] { background: var(--brand-soft); font-weight: 600; }
.pe-cmi[aria-checked="true"] .pe-cmic { color: var(--brand); }
.pe-alon svg { color: var(--brand); }
.pe-zv { height: 36px; min-width: 60px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.pe-zv:hover { background: var(--surface-2); }
.pe-sep { flex: 0 0 auto; width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.pe-pages { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.pe-pg { flex: 0 0 auto; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 64px; height: 64px; box-sizing: border-box; padding: 4px 6px; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--muted); font: inherit; }
.pe-pg canvas { display: block; max-width: 72px; max-height: 38px; width: auto; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 10px 10px; }
.pe-pg span { font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.pe-pg:hover { border-color: var(--btn2-border-hover); }
.pe-pg[aria-current=true] { border-color: var(--brand); color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pe-pg[aria-current=true] span { font-weight: 600; }
.pe-pg:focus-visible, .pe-pgadd:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-pgadd { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 64px; box-sizing: border-box; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.pe-pgadd:hover { border-color: var(--brand); background: var(--brand-soft); }
.pe-rsz { display: flex; flex-direction: column; gap: 10px; }
.pe-rsz .pe-acts { margin-top: 4px; }
.pe-cvfold { border-top: 1px solid var(--line); padding-top: 10px; }
.pe-cvfold > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.pe-cvbox { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.pe-npick { display: flex; flex-direction: column; gap: 8px; }
/* the quick bar above the picture */
.pe-selbar { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; min-height: 48px; box-sizing: border-box; padding: 5px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pe-r); box-shadow: var(--pe-card); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.pe-selbar::-webkit-scrollbar { display: none; }
.pe-selbar .btn { flex: 0 0 auto; border-color: transparent; background: transparent; padding: 0 9px; font-size: 13px; font-weight: 500; }
.pe-selbar .btn:hover { background: var(--surface-2); }
.pe-selbar .btn[aria-pressed="true"], .pe-selbar .btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--ink); }
.pe-selbar .btn[aria-pressed="true"] svg, .pe-selbar .btn[aria-expanded="true"] svg { color: var(--brand); }
.pe-chip2 { flex: 0 1 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; margin-right: 4px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: var(--fs-label); font-weight: 600; max-width: 200px; min-width: 0; }
.pe-chip2 svg { color: var(--brand); flex: 0 0 auto; }
.pe-chip0 { width: 32px; padding: 0; justify-content: center; margin-right: 2px; }
.pe-phd.pe-barwrap { flex-wrap: wrap; row-gap: 6px; } /* round 61: a bar too long for the head row gets its own line(s) under it */
.pe-hasbar.pe-barwrap > .pe-phl { display: flex; flex: 1 1 0; } /* the head row keeps the page name; the bar's own page chip is not needed then */
.pe-selbar.is-wrap .pe-pgc { display: none; }
.pe-phd.pe-barwrap > .pe-selbar.is-wrap { order: 3; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; white-space: normal; row-gap: 4px; }
.pe-selbar.is-ovf { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.pe-selt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-ctxr { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding-left: 8px; }
.pe-step { display: inline-flex; align-items: center; gap: 2px; }
.pe-szi { width: 48px; height: 32px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-label); text-align: center; font-variant-numeric: tabular-nums; }
.pe-szi:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.pe-sw2 { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,23,42,.18), 0 0 0 2px var(--surface); background-image: none; }
.pe-fbtn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; max-width: 170px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: var(--fs-body); cursor: pointer; }
.pe-fbtn:hover { border-color: var(--btn2-border-hover); }
.pe-fbtn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.pe-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-fch { display: inline-flex; color: var(--muted); flex: 0 0 auto; }
.pe-fbig { flex: 1 1 180px; height: var(--h-btn); max-width: none; font-size: var(--fs-h3); }
/* the options panel */
.pe-side { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pe-r); box-shadow: var(--pe-card); overflow: hidden; }
.pe-ph { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-body); font-weight: 600; line-height: 1.2; padding-right: 52px; font-size: 15px; }
.pe-ph svg { color: var(--brand); flex: 0 0 auto; }
.pe-ph { align-items: flex-start; }
.pe-ph > svg { margin-top: 1px; } /* round 28: the icon sits on the title line */
.pe-pht { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pe-phn { display: flex; align-items: center; gap: 8px; }
.pe-ph small { font-size: var(--fs-meta); color: var(--muted); font-weight: 400; line-height: 1.35; }
.pe-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font: 600 11px/1 var(--mono); } /* round 28: the shortcut as a key */
/* round 28-30 (owner): Remove BG works ON the photo. Round 30: smooth (transform only), the light goes down and back up, a modern look:
   a soft color glow that drifts, one bright scan line with a glow on both sides, a turning gradient edge, a glass pill with three dots */
@property --pe-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.pe-bgscan { position: absolute; z-index: 2; pointer-events: none; overflow: hidden; border-radius: 4px; transform-origin: 50% 50%; background: rgba(15,23,42,.12); box-shadow: inset 0 0 40px rgba(124,58,237,.35); transition: opacity .5s ease; }
.pe-bgscan.is-done { opacity: 0; }
.pe-bgsg { position: absolute; inset: -25%; background: radial-gradient(38% 32% at 30% 30%, rgba(124,58,237,.30), transparent 70%), radial-gradient(34% 30% at 72% 68%, rgba(6,182,212,.26), transparent 70%), radial-gradient(30% 26% at 60% 20%, rgba(236,72,153,.16), transparent 70%); mix-blend-mode: screen; animation: pe-bgsg 7s ease-in-out infinite alternate; will-change: transform; }
.pe-bgsb { position: absolute; inset: 0; animation: pe-bgsb 2.8s cubic-bezier(.65,0,.35,1) infinite alternate; will-change: transform; }
.pe-bgsb::before { content: ""; position: absolute; left: 0; right: 0; top: -10%; height: 20%; background: linear-gradient(180deg, transparent, rgba(167,139,250,.22) 45%, rgba(103,232,249,.22) 55%, transparent); }
.pe-bgsb::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.95) 18%, #fff 50%, rgba(255,255,255,.95) 82%, transparent); box-shadow: 0 0 10px 2px rgba(167,139,250,.9), 0 0 28px 8px rgba(124,58,237,.45); }
.pe-bgsc { position: absolute; inset: 0; padding: 3px; border-radius: inherit; background: conic-gradient(from var(--pe-a), #7C3AED, #06B6D4, #A78BFA, #EC4899, #7C3AED); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: pe-bgsc 4s linear infinite; }
.pe-bgsp { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 8px 16px 8px 12px; border-radius: 999px; background: rgba(17,17,27,.58); border: 1px solid rgba(255,255,255,.18); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: .01em; white-space: nowrap; box-shadow: 0 10px 30px rgba(15,23,42,.35); }
.pe-bgst { overflow: hidden; text-overflow: ellipsis; }
.pe-bgsd { display: inline-flex; gap: 4px; }
.pe-bgsd i { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, #A78BFA, #22D3EE); animation: pe-bgsd 1.2s ease-in-out infinite; }
.pe-bgsd i:nth-child(2) { animation-delay: .15s; }
.pe-bgsd i:nth-child(3) { animation-delay: .3s; }
.pe-bgscan.is-small .pe-bgsp { font-size: 11px; padding: 5px 10px 5px 8px; bottom: 6px; gap: 6px; }
.pe-bgscan.is-small .pe-bgsc { padding: 2px; }
@keyframes pe-bgsb { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes pe-bgsg { from { transform: translate(-6%, -4%) rotate(0deg); } to { transform: translate(6%, 5%) rotate(18deg); } }
@keyframes pe-bgsc { to { --pe-a: 360deg; } }
@keyframes pe-bgsd { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pe-bgsb, .pe-bgsg, .pe-bgsc, .pe-bgsd i { animation: none; } .pe-bgsb { transform: translateY(45%); } }
.pe-opt { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.pe-sec { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.pe-opt > :first-child { border-top: 0; }
.pe-sec .pe-sec { padding: 4px 0 0; border-top: 0; }
.pe-sec:has(> .btn-brand:only-child) { padding: 16px 0 0; }
.pe-sh { display: flex; align-items: center; gap: var(--sp-2); }
.pe-st { margin: 0; font-size: var(--fs-meta); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pe-foldb { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.pe-fold > summary { list-style: none; cursor: pointer; border-radius: 8px; }
.pe-fold > summary::-webkit-details-marker { display: none; }
.pe-fold > summary .pe-fch { margin-left: auto; transition: transform .2s ease; }
.pe-fold[open] > summary .pe-fch { transform: rotate(180deg); }
.pe-fold > summary:hover .pe-st { color: var(--ink); }
.pe-fold > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-top2 { padding-top: 16px; }
.pe-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 8px; text-align: center; }
.pe-note { font-size: var(--fs-label); color: var(--muted); margin: 0; line-height: var(--lh-text); }
/* sliders: thin track, brand fill (from 0 for ±), white thumb */
.pe-sl { display: flex; flex-direction: column; gap: 8px; }
.pe-sl label { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); font-size: var(--fs-label); color: var(--ink); font-weight: 500; }
.pe-ov { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; font-size: var(--fs-meta); min-width: 40px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); text-align: center; }
.pe-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; --p: 50%; --z: 0%; --fill: linear-gradient(90deg, var(--brand) 0 var(--p), var(--pe-track) var(--p) 100%); }
.pe-range.pe-mid { --fill: linear-gradient(90deg, var(--pe-track) 0 min(var(--z), var(--p)), var(--brand) min(var(--z), var(--p)) max(var(--z), var(--p)), var(--pe-track) max(var(--z), var(--p)) 100%); }
.pe-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--fill); }
.pe-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill); }
.pe-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.28); margin-top: -7px; transition: transform .12s ease; }
.pe-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.28); }
.pe-range:hover::-webkit-slider-thumb, .pe-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.pe-range:focus-visible { outline: none; }
.pe-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand); }
.pe-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand); }
@media (pointer: coarse) { .pe-range { height: 28px; } .pe-range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; } .pe-range::-moz-range-thumb { width: 24px; height: 24px; } }
/* segmented choices, switches, chips */
.pe .pe-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 0; border-radius: 12px; background: var(--surface-2); }
.pe .pe-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; box-shadow: none; }
.pe .pe-seg button:hover { color: var(--ink); }
.pe .pe-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.12), 0 1px 6px rgba(15,23,42,.06); }
.pe .pe-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pe .pe-seg.is-stack { display: grid; grid-template-columns: 1fr; width: 100%; } /* round 54: save box choices that would wrap 2 + 1 go one under the other */
.pe .pe-seg.is-stack button { justify-content: flex-start; }
.pe-seg button svg { display: block; }
.pe-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-min) var(--sp-3); }
.pe-rl { font-size: var(--fs-label); color: var(--muted); font-weight: 500; margin: 0; }
.pe-chk { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); cursor: pointer; min-height: var(--tap); }
.pe-chk input { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }
.pe-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--tap); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
.pe-switch input { -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 42px; height: 24px; margin: 0; border-radius: 999px; cursor: pointer; background: radial-gradient(circle at 12px 50%, #fff 9px, transparent 9.5px), var(--pe-track); transition: background-color .15s ease; }
.pe-switch input:checked { background: radial-gradient(circle at calc(100% - 12px) 50%, #fff 9px, transparent 9.5px), var(--brand); }
.pe-switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-swt { display: none; }
.pe .pe-chips .chip[aria-pressed="true"], .pe .pe-fgs .chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); font-weight: 600; }
.pe-acts, .pe-lrow { display: flex; flex-wrap: wrap; gap: var(--gap-min); }
.pe-chips { display: flex; flex-wrap: wrap; gap: var(--gap-min); }
.pe-tipt { margin: 0; }
.pe-cmpb[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
/* colors */
.pe-col { display: flex; flex-direction: column; gap: 8px; }
.pe-cbtn { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.pe-cbtn:hover { border-color: var(--btn2-border-hover); }
.pe-cbtn[aria-expanded="true"] { border-color: var(--brand); }
.pe-cbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-sw { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,23,42,.18); flex: 0 0 auto; }
.pe-cl { flex: 0 1 auto; font-weight: 500; }
.pe-cbtn .pe-fch { margin-left: auto; } /* round 27 (owner): the color code sits next to its name, no empty middle */
.pe-hx { font-family: var(--mono); font-size: var(--fs-label); color: var(--muted); }
.pe-pal { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.pe-swr { display: flex; flex-direction: column; gap: 6px; }
.pe-swr .pe-rl { font-size: var(--fs-meta); color: var(--ink); }
.pe-sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 8px; justify-items: center; }
.pe-s { width: 100%; max-width: 30px; aspect-ratio: 1; min-width: 0; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(15,23,42,.16); cursor: pointer; padding: 0; transition: transform .12s ease, box-shadow .12s ease; }
.pe-s:hover { transform: scale(1.12); }
.pe-s:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-crow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-min); }
.pe-more { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-label); font-weight: 600; cursor: pointer; overflow: hidden; }
.pe-cin { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.pe-rainbow { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(#EF4444, #F59E0B, #EAB308, #22C55E, #06B6D4, #3B82F6, #8B5CF6, #EC4899, #EF4444); flex: 0 0 auto; }
.pe-more:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-hin { width: 96px; height: 36px; min-height: 36px; box-sizing: border-box; font-family: var(--mono); font-size: var(--fs-label); }
.pe-paint, .pe-grad { display: flex; flex-direction: column; gap: var(--gap-item); }
.pe-gpre { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.pe-gs { border-radius: 9px; max-width: none; aspect-ratio: 1; }
.pe-stop { display: flex; flex-direction: column; gap: var(--gap-min); padding: var(--sp-3); border: 1px dashed var(--line); border-radius: 12px; }
/* filters, shapes, text */
.pe-flts { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.pe-flt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 4px 6px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font: inherit; font-size: var(--fs-meta); font-weight: 600; cursor: pointer; }
.pe-flt canvas { width: 100%; height: 66px; object-fit: cover; border-radius: 9px; display: block; }
.pe-flt:hover { border-color: var(--btn2-border-hover); }
.pe-flt[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); color: var(--ink); }
.pe-flt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-lib { display: flex; flex-direction: column; gap: 12px; }
.pe-libr { display: flex; flex-direction: column; gap: 16px; }
.pe-libg { display: flex; flex-direction: column; gap: 8px; }
.pe-q2 { width: 100%; box-sizing: border-box; min-height: 40px; border-radius: 12px; }
.pe-shps { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.pe-shb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font: inherit; font-size: var(--fs-meta); line-height: 1.2; cursor: pointer; text-align: center; min-height: 78px; transition: border-color .12s ease, transform .12s ease; }
.pe-shb:hover { border-color: var(--brand); transform: translateY(-1px); }
.pe-shb[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.pe-shb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-shb canvas { width: 40px; height: 40px; }
.pe-mgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pe-mgrid .pe-shb { min-height: 52px; padding: 6px 2px; }
.pe-mgrid .pe-shb canvas { width: 32px; height: 32px; }
.pe-ta { width: 100%; max-width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px; font-family: inherit; font-size: var(--fs-body); padding: var(--pad-field); border-radius: 12px; }
.pe-frow { display: flex; flex-wrap: wrap; gap: var(--gap-min); align-items: center; }
.pe-addt { display: flex; flex-direction: column; gap: 8px; }
.pe-addb { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; line-height: 1.25; transition: border-color .12s ease, background-color .12s ease; }
.pe-addb:hover { border-color: var(--brand); background: var(--brand-soft); }
.pe-addb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-a1 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -.01em; }
.pe-a2 { font-size: var(--fs-h3); font-weight: 600; }
.pe-a3 { font-size: var(--fs-sm); }
.pe-tsg { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.pe-ts { display: flex; align-items: center; justify-content: center; height: 64px; padding: 0 8px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #0F172A, #273449); color: #fff; font-size: var(--fs-h3); cursor: pointer; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.pe-ts:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--brand); }
.pe-ts:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-tsf { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.3; }
.pe-bands { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-band { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(15,23,42,.15); }
.pe-band[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.pe-band:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.pe-mix { display: flex; flex-direction: column; gap: 12px; }
/* pop-up boxes */
.pe-pop { position: absolute; z-index: 40; width: min(340px, calc(100% - 16px)); box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 6px rgba(15,23,42,.08), 0 24px 48px -16px rgba(15,23,42,.35); }
.pe-poph { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pe-popt { margin: 0; font-size: var(--fs-label); font-weight: 600; }
.pe-popb { display: flex; flex-direction: column; gap: 12px; }
.pe-fp { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pe-fl { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pe-fo { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: var(--fs-h3); cursor: pointer; text-align: left; white-space: nowrap; }
.pe-fo span { overflow: hidden; text-overflow: ellipsis; }
.pe-fo small { font-family: var(--font, system-ui), sans-serif; font-size: var(--fs-meta); color: var(--muted); }
.pe-fo:hover { background: var(--surface-2); }
.pe-fo[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand); }
.pe-fo:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pe-fgs { gap: 6px; }
/* canvas size */
.pe-custom, .pe-wh { display: flex; align-items: flex-end; gap: var(--gap-min); font-size: var(--fs-sm); }
.pe-anc { display: grid; grid-template-columns: repeat(3, 36px); gap: var(--sp-2); }
.pe-anc button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.pe-anc button span { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.pe-anc button[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.pe-anc button[aria-checked="true"] span { background: var(--brand); }
/* curves */
.pe-curve { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); line-height: 0; max-width: 220px; touch-action: none; }
.pe-curve canvas { cursor: crosshair; touch-action: none; }
.pe-fold .pe-chips { padding-top: var(--sp-2); }
/* layers */
.pe-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.pe-li { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 4px; }
.pe-li.is-sel { border-color: var(--brand); background: var(--brand-soft); }
.pe-li.is-grp { border-left: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.pe-lpick { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 6px; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.pe-lpick canvas { width: 40px; height: 40px; border-radius: 8px; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 10px 10px; flex: 0 0 auto; }
.pe-ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-gtag { display: inline-flex; color: var(--brand); margin-left: auto; }
.pe-lic { width: var(--tap); height: var(--tap); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.pe-lic:hover { background: var(--surface-2); color: var(--ink); }
.pe-lic[aria-pressed="true"] { color: var(--brand); }
.pe-align .pe-ib { background: var(--surface-2); }

/* ===== dialogs (inside the editor) ===== */
.pe-dlgw { position: absolute; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: var(--sp-4); background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-radius: 20px; }
.pe-dlg { width: min(880px, 100%); max-height: 100%; box-sizing: border-box; overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap-item); box-shadow: 0 24px 64px -16px rgba(15,23,42,.4); background: var(--surface); border-radius: 18px; }
.pe-dlg.is-busy { cursor: progress; }
.pe-dhd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pe-dlgt { font-size: var(--fs-h3); margin: 0; }
.pe-ic { width: var(--h-btn-sm); padding: 0; justify-content: center; }
.pe-fmts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--gap-min); } /* round 21 (owner): 4 cards a line on a wide screen, so the box is shorter */
.pe-fmt { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: var(--pad-card); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-height: 64px; }
.pe-fmt b { font-size: var(--fs-sm); }
.pe-fmt small { font-size: var(--fs-meta); color: var(--muted); line-height: 1.35; }
.pe-fmt[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.pe-fmt[aria-checked="true"] small { color: var(--ink); }
.pe-fmt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-fmore .pe-fmt { min-height: 56px; }
.pe-dsets { display: flex; flex-direction: column; gap: var(--gap-item); padding-top: var(--sp-1); }
.pe-win { width: 110px; }
.pe-nin { flex: 1 1 200px; min-width: 0; }
.pe-ext { font-family: var(--mono); font-size: var(--fs-label); color: var(--muted); }
.pe-dinfo { margin: 0; font-size: var(--fs-sm); color: var(--ink); font-variant-numeric: tabular-nums; }
.pe-dacts { display: flex; flex-wrap: wrap; gap: var(--gap-min); }
.pe-printf { position: fixed; width: 0; height: 0; border: 0; left: -10px; top: -10px; }
.pe-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap-block) 24px; }
.pe-kcol { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.pe-kcol h3 { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-meta); }
.pe-dlgk { width: min(860px, 100%); }
.pe-kl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: var(--fs-label); align-items: center; }
.pe-kl dt { color: var(--muted); }
.pe-kl dd { margin: 0; }
.pe kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: var(--fs-meta); text-align: center; }

/* ===== full screen ===== */
.pe.pe-isfull { position: fixed; inset: 0; z-index: 9990; margin: 0; max-width: none; border-radius: 0; overflow: auto; background: var(--bg); padding: 0; }
.pe-isfull .pe-ed { border: 0; border-radius: 0; min-height: 100%; box-shadow: none; }
.pe-isfull .pe-body { height: calc(100vh - 61px); height: calc(100dvh - 61px); }
.pe-isfull > .pe-priv, .pe-isfull > .ag-how { display: none; }
body.pe-noscroll { overflow: hidden; }

/* ===== narrower editors: the options go under the picture ===== */
@container pe (max-width: 979px) {
  .pe-body { grid-template-columns: 76px minmax(0, 1fr) 76px; height: auto; }
  .pe-left { height: clamp(460px, 68vh, 760px); }
  .pe-rail { max-height: clamp(460px, 68vh, 760px); }
  .pe-side { grid-column: 1 / -1; }
  .pe-opt { overflow: visible; }
  .pe-opt .pe-libhd { position: static; }
  .pe-isfull .pe-body { height: auto; }
}
@container pe (max-width: 679px) {
  .pe-top { padding: 8px; min-height: 52px; gap: 4px; }
  .pe-rszb span { display: none; }
  .pe-top .pe-g .pe-ib { width: 32px; min-width: 32px; padding: 0; justify-content: center; }
  .pe-right { gap: 4px; }
  .pe-addp { width: 36px; padding: 0; justify-content: center; }
  .pe-addp span, .pe-l1 { display: none; }
  .pe-l2 { display: inline; }
  .pe-body { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 8px; }
  .pe-left { height: auto; }
  .pe-stagew { flex: 0 0 auto; height: clamp(300px, 56vh, 520px); }
  #pe-tiles2 { grid-column: auto; grid-row: auto; }
  .pe-rail { order: 2; flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; gap: 2px; padding: 4px; scroll-snap-type: x proximity; }
  .pe-tile { flex: 0 0 66px; min-height: 56px; scroll-snap-align: start; }
  .pe-left { order: 1; }
  .pe-side { order: 3; }
  .pe-ph { padding: 12px 14px; }
  .pe-ph small { display: none; }
  .pe-opt { padding: 0 14px 14px; }
  .pe-zv { min-width: 52px; }
  .pe-keys { grid-template-columns: minmax(0, 1fr); }
  .pe-isfull .pe-stagew { height: 48vh; }
  /* round 61 (owner): the tool rows stay in reach (pinned above the site's bottom bar) while the pages scroll; at the end of the editor they sit in place again */
  .pe-body > .pe-rail { position: sticky; z-index: 6; box-shadow: 0 -2px 12px rgba(15, 23, 42, .10); }
  .pe-body > #pe-tiles { bottom: calc(var(--pe-navh, 0px) + 82px); }
  .pe-body > #pe-tiles2 { bottom: calc(var(--pe-navh, 0px) + 8px); }
  .pe-isfull .pe-body > .pe-rail { position: static; }
}

/* ===== start screen on smaller screens ===== */
@container tool (width <= 36rem) {
  .pe-fmts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-dropa svg { width: 160px; height: 102px; }
  .pe-dimg { width: 72px; height: 72px; }
  .pe-dlgw { padding: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) { .pe-tile svg, .pe-shb, .pe-ts, .pe-s, .pe-range::-webkit-slider-thumb, .pe-fold > summary .pe-fch { transition: none; } }
@media print { .pe-ed, .pe-start { display: none; } }
.pe-nrow { align-items: center; }
.pe-shp .pe-shpc { border-style: dashed; }
/* drop box picture: three photos and a plus, drawn in the brand colours */
.pe-dropa { display: block; line-height: 0; margin-bottom: var(--sp-2); }
.pe-ia { fill: var(--surface); stroke: color-mix(in srgb, var(--brand) 35%, var(--line)); stroke-width: 1.5; }
.pe-ifront { stroke: var(--brand); }
.pe-ib { fill: var(--brand-soft); }
.pe-ic1 { fill: #F59E0B; }
.pe-ic2 { fill: color-mix(in srgb, var(--brand) 55%, transparent); }
.pe-iplus { fill: var(--brand); }

/* ===== round 6 ===== */
/* lighter type everywhere in the editor */
.pe-ed .btn { font-weight: 500; }
.pe-ed .btn-brand { font-weight: 600; }
.pe-tile svg { width: 21px; height: 21px; }
.pe-tile svg, .pe-ib svg { stroke-width: 1.6; }
.pe-tile[data-t="select"] { margin-bottom: 4px; }
.pe-tile[data-t="select"] { flex-shrink: 0; }
.pe-tile[data-t="select"]::after { content: ""; display: block; width: 28px; height: 1px; margin-top: 7px; background: var(--line); }
/* options closed: the picture takes the room */
.pe-noside .pe-body { grid-template-columns: 84px minmax(0, 1fr) 84px; }
.pe-noside .pe-side { display: none; }
.pe-phx { position: absolute; top: 10px; right: 10px; z-index: 1; }
/* top bar */
.pe-top { gap: 12px; padding: 10px 14px; }
.pe-right { gap: 6px; }
.pe-addp, .pe-savebtn { white-space: nowrap; }
.pe-tsep { flex: 0 0 auto; width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.pe-savebtn { padding: 0 16px; }
@container pe (max-width: 899px) { .pe-addp { width: 36px; padding: 0; justify-content: center; } .pe-addp .pe-l1 { display: none; } }
/* More menu */
.pe-menu { gap: 2px; }
.pe-mi { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pe-mi:hover, .pe-mi:focus-visible { background: var(--surface-2); outline: none; }
.pe-mi:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.pe-mii { flex: 0 0 auto; display: inline-flex; color: var(--brand); padding-top: 1px; }
.pe-mit { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pe-mit b { font-size: var(--fs-sm); font-weight: 500; }
.pe-mit small { font-size: var(--fs-meta); color: var(--muted); line-height: 1.35; }
/* work area: dark background, view buttons */
.pe-wsdark .pe-body { --pe-ws: #1F2430; }
.pe-wsdark .pe-pgadd { color: #E5E7EB; }
.pe-wsdark .pe-pgadd { border-color: rgba(255,255,255,.28); }
.pe-wsdark .pe-plist .pe-pgadd::before { background: rgba(255,255,255,.18); }
/* text bar extras */
.pe-aa { font-size: 13px; letter-spacing: .02em; }
.pe-intro { padding: 12px 14px; margin: 14px 0 2px; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
/* clone how-to */
.pe-howto { display: flex; gap: 12px; align-items: center; padding: 16px 0 4px; }
.pe-howi { flex: 0 0 auto; display: flex; }
.pe-howto .pe-note { margin: 0; }
.pe-steps { margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 8px; }
.pe-steps li { counter-increment: st; position: relative; padding: 0 0 0 34px; font-size: var(--fs-sm); color: var(--ink); line-height: 1.45; }
.pe-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--ink); font-size: var(--fs-meta); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pe-steps b { font-weight: 600; }
/* save box: size on every file type */
.pe-fsz { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 18px; font-size: var(--fs-meta); color: var(--ink); font-variant-numeric: tabular-nums; }
.pe-fsz.is-off { color: var(--muted); }
.pe-dl { font-size: var(--fs-meta); padding: 0 6px; border-radius: 999px; }
.pe-dl.is-dn { background: #DCFCE7; color: #14532D; }
.pe-dl.is-up { background: var(--surface-2); color: var(--ink); }
.pe-spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); animation: pe-spin .7s linear infinite; vertical-align: -2px; }
@keyframes pe-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pe-spin { animation-duration: 2.4s; } }
.pe-orig { margin: 0; }
.pe-sel { height: 36px; min-width: 0; flex: 1 1 160px; }
.pe-dsets .pe-fold { padding: 4px 0 0; border-top: 0; }
@container pe (max-width: 679px) {
  #pe-rul, #pe-smooth, #pe-wsbg, .pe-zpill .pe-sep:nth-of-type(2) { display: none; }
  .pe-noside .pe-body { grid-template-columns: minmax(0, 1fr); }
  .pe-tile[data-t="select"] { margin-bottom: 0; }
  .pe-tile[data-t="select"]::after { display: none; }
  .pe-top { gap: 6px; padding: 8px; }
}
/* (?) = this row explains itself when you point at it */
.pe-qm { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1; font-weight: 500; vertical-align: 1px; cursor: help; }
[title]:has(> .pe-qm), [title] > span:has(> .pe-qm), .pe-sl[title] label { cursor: help; }

/* ===== start screen v2 (round 7): sizes first, own photo below ===== */
.pe-start { gap: var(--gap-item); }
.pe-blank { gap: var(--sp-3); }
.pe-sgrp { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pe-sizes { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--sp-2); }
.pe-sizes > [hidden] { display: none; }
.pe-size { flex-direction: column; align-items: stretch; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-3); text-align: center; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
.pe-size:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.pe-szp { display: flex; align-items: center; justify-content: center; height: 64px; border-radius: calc(var(--r-card) - 4px); background: var(--surface-2); }
.pe-szp .pe-shp { width: 50px; height: 50px; }
.pe-szp .pe-shp span { border-width: 1.5px; border-radius: 4px; background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pe-size:has(input:checked) .pe-szp .pe-shp span { background: var(--brand-soft); }
.pe-szt { align-items: center; gap: var(--sp-1); }
.pe-szt b { font-weight: 600; line-height: var(--lh-tight); }
.pe-szu { line-height: var(--lh-tight); }
.pe-custom { flex-wrap: wrap; }
.pe-custom .pe-sel { flex: 0 1 120px; height: auto; }
.pe-nbgc { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.pe-hidc { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pe-bgrow { position: relative; }
.pe-turn { margin-left: auto; }
.pe-newgo { align-self: center; justify-content: center; min-width: min(100%, 320px); }
.pe-own { display: flex; flex-direction: column; gap: var(--gap-block); } /* round 56 (owner): parts of the photo tab sit the Spacing Ladder's block gap apart, like HEIC to JPG */
.pe-own > .pe-note { text-align: center; }
.pe-own .pe-dropa svg { width: 150px; height: 96px; }
/* rule 128: the paste spot under Paste a picture (takes Ctrl+V / Cmd+V or a touch-and-hold Paste) */
.pe-pin { display: flex; align-items: center; justify-content: center; min-height: var(--h-btn); padding: var(--pad-card); border: 2px dashed var(--brand); border-radius: var(--r-card); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); text-align: center; font-weight: 600; color: var(--ink); caret-color: transparent; outline: none; cursor: text; overflow: hidden; white-space: nowrap; }
.pe-pin:empty::before { content: attr(data-ph); color: var(--ink); white-space: normal; }
.pe-pin:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
@media print { .pe-pbox { display: none !important; } }
@container tool (width <= 36rem) {
  .pe-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pe-size { padding: 6px 4px 8px; gap: 6px; }
  .pe-szu, .pe-szpx { display: none; }
  .pe-szt small { letter-spacing: -.01em; }
  .pe-size:last-child .pe-szt small { white-space: normal; }
  .pe-szp { height: 46px; }
  .pe-szp .pe-shp { transform: scale(.72); }
  .pe-szt b { font-size: var(--fs-label); }
  .pe-szt small { font-size: 12px; }
  .pe-best { display: none; }
  .pe #pe-nbg button { padding: 0 8px; }
  .pe-turn { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .pe-size { transition: none; } }
.pe-fall { font-size: var(--fs-tag); color: var(--muted); font-weight: 500; }
.pe-size:has(input:checked) .pe-szt small { color: var(--ink); }
/* size cards v2 (round 8): wide and short, picture on the left (owner: cards were too tall and narrow) */
.pe .pe-sizes { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; align-items: start; }
.pe .pe-size { flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 10px 12px; text-align: left; }
.pe .pe-szp { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 10px; }
.pe .pe-szp .pe-shp { width: 40px; height: 40px; transform: scale(.82); }
.pe .pe-szt { align-items: flex-start; gap: 2px; min-width: 0; flex: 1 1 auto; }
.pe .pe-szt b, .pe .pe-szt small { max-width: 100%; overflow-wrap: anywhere; }
.pe .pe-szu { display: block; }
@container tool (width <= 36rem) {
  .pe .pe-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pe .pe-size { gap: 8px; padding: 8px; }
  .pe .pe-szp { flex-basis: 40px; width: 40px; height: 40px; }
  .pe .pe-szp .pe-shp { transform: scale(.62); }
  .pe .pe-szu { display: none; }
}
@container tool (width <= 36rem) { .pe .pe-szt b { white-space: normal; line-height: 1.2; } }
/* save box (round 9): one list of file types with a sort choice */
.pe-fhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pe-fhead .pe-rl { margin: 0; }
.pe .pe-fsort button { min-height: 32px; padding: 0 10px; }
.pe-spin-s { width: 9px; height: 9px; border-width: 1.5px; margin-left: 2px; }
.pe-fmt[aria-checked="true"] .pe-fall { color: var(--ink); }
/* start screen (round 10): unit box as tall as the other boxes, background swatches, shape preview next to Start */
.pe .pe-custom .pe-sel { flex: 0 0 auto; height: 46px; width: 100%; }
.pe-nbgc.pe-tchk, .pe-npv .pe-tchk { background-color: #fff; background-image: linear-gradient(45deg, #CBD5E1 25%, transparent 25%, transparent 75%, #CBD5E1 75%), linear-gradient(45deg, #CBD5E1 25%, transparent 25%, transparent 75%, #CBD5E1 75%); background-size: 6px 6px; background-position: 0 0, 3px 3px; }
.pe-nbgc.pe-rainbow { background: conic-gradient(#EF4444, #F59E0B, #EAB308, #22C55E, #06B6D4, #3B82F6, #8B5CF6, #EC4899, #EF4444); }
.pe-gorow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.pe-gorow .pe-newgo { align-self: auto; min-width: min(100%, 300px); }
.pe-gorow .pe-turn { margin-left: 0; }
.pe-npv { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2); }
.pe-npv > span { display: block; border: 2px solid var(--brand); border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); transition: width .3s ease, height .3s ease; }
.pe-shp > span { transition: width .3s ease, height .3s ease; }
@media (prefers-reduced-motion: reduce) { .pe-npv > span, .pe-shp > span { transition: none; } }
@container tool (width <= 36rem) { .pe-gorow .pe-newgo { flex: 1 1 100%; order: 3; } .pe-gorow { justify-content: flex-start; } }
/* ===== pages one under the other (round 11, like the big design apps) ===== */
.pe-plist { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px 0; scrollbar-width: thin; }
.pe-plist .pe-stagew { flex: 0 0 auto; height: 480px; }
.pe-pblk { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; border-radius: var(--pe-r); container: pblk / inline-size; }
@container pblk (max-width: 640px) { .pe-phl > .pe-pnow { display: none; } } /* round 31: a narrow page head drops "Editing", then the size, so the name and Resize page fit */
@container pblk (max-width: 580px) { .pe-phl > .pe-psz { display: none; } }
.pe-pblk.is-drop { box-shadow: 0 -4px 0 0 var(--brand); }
.pe-phd { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 2px 0 4px; font-size: var(--fs-sm); color: var(--ink); }
.pe-pblk.is-on > .pe-phd { min-height: 48px; } /* round 22: the bar takes this row, so its height never jumps */
.pe-phl { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow: hidden; } /* round 31: nothing runs under the page buttons; round 71 (rule 151): when the name, "Page N of M" and Resize page do not fit on one line, Resize page goes to a second line instead of being cut */
.pe-phl > .pe-pnum { flex: 0 1 auto; min-width: 44px; }
.pe-pttl { min-width: 0; }
.pe-phl > .pe-pnow, .pe-phl > .pe-psz, .pe-phl > .pe-pnumt { flex: 0 0 auto; white-space: nowrap; }
.pe-hasbar > .pe-phl { display: none; }
.pe-pnum { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; padding: 4px 6px; border: 1px dashed transparent; border-radius: 8px; background: none; color: inherit; font: inherit; font-weight: 600; white-space: normal; cursor: text; }
.pe-pnum:hover, .pe-pnum:focus-visible { border-color: var(--muted); outline: none; }
.pe-pttl { font-weight: 500; overflow-wrap: anywhere; max-width: 260px; } /* round 70: rule 151, no "…": a long page name wraps */
.pe-pttl.is-empty { color: var(--muted); font-weight: 400; }
.pe-psz { color: var(--muted); font-size: var(--fs-label); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pe-pnow { padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); font-size: var(--fs-label); font-weight: 500; }
.pe-pacts { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.pe .pe-pib.is-off { opacity: .35; pointer-events: none; }
.pe-pgrip { cursor: grab; touch-action: none; }
.pe-pdrag, .pe-pdrag * { cursor: grabbing !important; user-select: none; }
.pe-pprev { display: flex; align-items: center; justify-content: center; width: 100%; padding: 18px; border: 0; border-radius: var(--pe-r); background: var(--pe-ws, var(--surface-2)); cursor: pointer; transition: box-shadow .15s ease; }
.pe-pprev canvas { display: block; max-width: 100%; max-height: min(52vh, 480px); width: auto; height: auto; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); background: repeating-conic-gradient(#E5E7EB 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.pe-pprev:hover, .pe-pprev:focus-visible { box-shadow: 0 0 0 2px var(--brand); outline: none; }
.pe-pgap { position: relative; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; height: 30px; }
.pe-pgap::before { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1px; background: var(--line); }
.pe-pplus { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.pe-pplus:hover, .pe-pplus:focus-visible { border-color: var(--brand); color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.pe-plist .pe-pgadd { position: relative; width: 100%; height: 44px; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; } /* round 31 (owner): the last Add page sits on a line, like the "+" between pages */
.pe-plist .pe-pgadd::before { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1px; background: var(--line); }
.pe-plist .pe-pgadd:hover { background: none; }
.pe-pgaddi { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; transition: border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.pe-plist .pe-pgadd:hover .pe-pgaddi, .pe-plist .pe-pgadd:focus-visible .pe-pgaddi { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pe-pdel { white-space: nowrap; }
@container pe (max-width: 679px) {
  .pe-plist { overflow: visible; padding: 0; }
  .pe-plist .pe-stagew { height: clamp(300px, 56vh, 520px); }
  .pe-psz, .pe-pnow { display: none; }
  .pe-phd { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .pe-pprev { transition: none; } }
.pe-plist.is-drop-end .pe-pgadd { box-shadow: 0 -4px 0 0 var(--brand); }
.pe-pgap { height: 46px; }
.pe-pblk { gap: 8px; }
/* ===== round 12: slim file type cards, size search, modern color picker ===== */
.pe-fmt { min-height: 0; }
.pe-fmts .pe-fmt { padding-top: 12px; padding-bottom: 12px; }
.pe-sfind { flex: 1 1 220px; display: flex; justify-content: flex-end; min-width: 180px; }
.pe-sfind .inp { width: 100%; max-width: 300px; height: 36px; box-sizing: border-box; }
.pe-snone { margin: 0; }
.pe-bgrow { position: relative; }
.pe-ncbox { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(320px, calc(100vw - 48px)); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.pe-ncbox .pe-acts { justify-content: flex-end; }
.pe-spec { display: flex; flex-direction: column; gap: 10px; }
.pe-sv { position: relative; height: 160px; border-radius: 10px; cursor: crosshair; touch-action: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.pe-sv:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-svk { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .3); transform: translate(-50%, -50%); pointer-events: none; }
.pe-spect { display: flex; align-items: center; gap: 10px; }
.pe-specp { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.pe-hue { flex: 1 1 auto; -webkit-appearance: none; appearance: none; height: 12px; border-radius: 999px; background: linear-gradient(to right, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); margin: 0; cursor: pointer; }
.pe-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3); }
.pe-hue::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3); }
.pe-hue:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.pe-cgs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pe-cg { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 8px; }
.pe-cgl { font-size: var(--fs-label); color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.pe-cgf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pe .pe-cf { height: 34px; min-width: 0; width: 100%; padding: 0 8px; box-sizing: border-box; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: center; }
.pe .pe-cfh { grid-column: 1 / -1; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pe-pal .pe-spec { padding-top: 4px; }
button.pe-more { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
button.pe-more[aria-expanded="true"] { border-color: var(--brand); background: var(--brand-soft); }
/* ===== round 13: text color buttons with a color bar, page count in the quick bar, centred chip icon ===== */
.pe-chip2 > span:first-child { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.pe-ib.pe-cbar { position: relative; flex-direction: column; justify-content: center; gap: 3px; padding: 0; }
.pe-cbg { display: inline-flex; align-items: center; justify-content: center; height: 18px; line-height: 1; color: var(--ink); }
.pe-cbg svg { width: 16px; height: 16px; }
.pe-cbA { font-weight: 700; font-size: 16px; font-family: inherit; }
.pe-cbl { display: block; width: 20px; height: 4px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .18); }
.pe-cbl.is-none { background: repeating-conic-gradient(#cbd5e1 0% 25%, #fff 0% 50%) 0 0 / 4px 4px; }
.pe-pgc { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; margin-right: 6px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.pe-pgc svg { color: var(--brand); }
.pe-pgc:hover { background: var(--brand-soft); }
.pe-pgc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* ===== round 14: New button, cut shapes in Crop, crisper rail icons ===== */
.pe-newb { margin-left: 2px; }
.pe-newbox { max-width: 340px; }
.pe-newacts { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 8px; }
.pe-newacts .btn { justify-content: flex-start; }
.pe-cutk { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.pe-cutk:has(> :nth-child(6)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* round 42: six ways (Crop & Cut with Pen) = two even rows of three, never one alone */
.pe-cutb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 500; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.pe-cutb svg { color: var(--ink); }
.pe-cutb:hover { border-color: var(--brand); }
.pe-cutb[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pe-cutb[aria-pressed="true"] svg { color: var(--brand); }
.pe-cutb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-cutk + .pe-mgrid { margin-bottom: 12px; }
.pe-cutnow { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pe-cutnow .pe-note { margin: 0; }
@container pe (max-width: 679px) {
  .pe-newb, .pe-top .pe-addp { width: 32px; min-width: 32px; padding: 0; justify-content: center; flex: 0 0 32px; }
  .pe-top .pe-tsep { display: none; }
  .pe-top .pe-g { gap: 2px; }
  .pe-top { gap: 4px; }
  .pe-savebtn { padding: 0 12px; }
}
@container pe (max-width: 400px) { #pe-full { display: none; } .pe .pe-top .pe-savebtn { padding: 0 10px; } .pe .pe-top { padding-left: 4px; padding-right: 4px; gap: 2px; } .pe .pe-top .pe-g { gap: 0; } }
.pe-newb svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pe .pe-top { flex-wrap: wrap; row-gap: 4px; } /* round 69: on a very narrow editor the right group (Add photo, More, Save) takes its own line instead of being cut (rule 151) */
.pe .pe-top > .pe-right { margin-left: auto; }
/* ===== round 15: dark work area text, typed zoom, centred resize buttons, line-up menu ===== */
.pe-wsdark .pe-phd { color: #F1F5F9; }
.pe-wsdark .pe-psz { color: #CBD5E1; }
.pe-wsdark .pe-pib, .pe-wsdark .pe-pgrip { color: #E2E8F0; }
.pe-wsdark .pe-pib:hover, .pe-wsdark .pe-pgrip:hover { background: rgba(255,255,255,.1); }
.pe-wsdark .pe-pnow { background: rgba(165,180,252,.18); color: #E0E7FF; }
.pe-wsdark .pe-pgap::before { background: rgba(255,255,255,.18); }
.pe .pe-zv { width: 58px; height: 32px; padding: 0 4px; box-sizing: border-box; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; cursor: text; }
.pe .pe-zv:hover { border-color: var(--line); }
.pe .pe-zv:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.pe-rsz .pe-acts { justify-content: center; }
.pe-alb { position: relative; }
.pe-alc { position: absolute; right: 5px; bottom: 5px; width: 0; height: 0; border-left: 4px solid transparent; border-top: 4px solid currentColor; opacity: .55; transform: rotate(-45deg); }
.pe-almenu { min-width: 170px; }
.pe-ali[aria-pressed="true"] { background: var(--brand-soft); }
/* ===== round 16: maker label on JPG / PNG / WebP cards ===== */
.pe-fmk { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: var(--fs-meta); font-weight: 600; vertical-align: 1px; }
.pe-fmt[aria-checked="true"] .pe-fmk { border-color: var(--brand); color: var(--ink); }
/* ===== round 17: Turn + angle box for anything chosen ===== */
.pe-rotc { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.pe-rotc .pe-rotb:not(:has(span)) { padding: 0 6px; min-width: 32px; }
.pe-angw { position: relative; display: inline-flex; align-items: center; }
.pe .pe-angi { width: 50px; padding: 0 15px 0 2px; text-align: right; }
.pe-angu { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-label); pointer-events: none; }
/* ===== round 18: reset buttons, blend, copy style, history, rename ===== */
.pe-slv { display: inline-flex; align-items: center; gap: 4px; }
.pe .pe-ovi { width: 52px; min-width: 0; padding: 2px 6px; border: 1px solid var(--line); text-align: right; font: inherit; font-size: var(--fs-meta); font-weight: 500; color: var(--ink); } /* round 66: the value box you can type in */
.pe .pe-ovi:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }
.pe-ovu { color: var(--muted); font-size: var(--fs-meta); }
.pe-slr { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.pe-slr:hover { background: var(--surface-2); color: var(--brand); }
.pe-slr:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pe-sh .pe-secr { margin-left: auto; min-height: 28px; padding: 0 8px; border-color: transparent; background: transparent; color: var(--ink); font-size: var(--fs-meta); }
.pe-sh .pe-secr:hover { background: var(--brand-soft); }
.pe-blrow { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: var(--fs-label); font-weight: 500; color: var(--ink); }
.pe-blrow .pe-blic { display: inline-flex; color: var(--muted); }
.pe-blrow .pe-blsel { margin-left: auto; width: auto; min-width: 140px; height: 36px; }
.pe-strow { margin-top: 10px; }
.pe-hist { width: 100%; min-width: 0; }
.pe-hlist { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; margin-top: 8px; }
.pe-hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
button.pe-hrow:hover { background: var(--surface-2); }
.pe-hrow small { color: var(--muted); font-size: var(--fs-meta); white-space: nowrap; }
.pe-hrow .pe-hlab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-hrow.is-now { background: var(--brand-soft); font-weight: 600; cursor: default; }
.pe-hrow.is-undone { color: var(--muted); }
.pe-hrow.is-start { color: var(--muted); cursor: default; }
.pe-lren { flex: 1 1 auto; min-width: 0; height: 32px; }

/* ===== round 19: bigger work area, place a photo, blur a part, cut out, line up ===== */
.pe-ed { scroll-margin-top: calc(var(--pe-top, 0px) + 8px); }
.pe-pgadd1 { margin-left: 4px; white-space: nowrap; }
.pe-placeb { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 16px); padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--pe-card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow-x: auto; scrollbar-width: none; }
.pe-plt { flex: 0 0 auto; font-size: var(--fs-label); font-weight: 600; color: var(--ink); white-space: nowrap; margin-right: 2px; }
.pe-plb { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-label); white-space: nowrap; cursor: pointer; }
.pe-plb:hover { background: var(--surface-2); }
.pe-plb[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.pe-plb:focus-visible, .pe-plx:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pe-plx { flex: 0 0 auto; border-radius: 999px; }
.pe-plrow { flex-wrap: wrap; }
.pe-blk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.pe-blkb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 500; line-height: 1.2; text-align: center; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.pe-blkb:hover { border-color: var(--brand); }
.pe-blkb[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pe-blkb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-blist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.pe-brow { display: flex; align-items: center; gap: 8px; border-radius: 10px; }
.pe-brow.is-on { background: var(--brand-soft); }
.pe-bsel { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.pe-bsel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-bsel:hover { background: var(--surface-2); }
.pe-bsel:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pe-alignw { display: flex; flex-direction: column; gap: 8px; }
.pe-alignw > .pe-seg { align-self: flex-start; }
@media (prefers-reduced-motion: reduce) { .pe-blkb { transition: none; } }
.pe-cutacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 12px; }
.pe-cutacts .btn { justify-content: flex-start; width: 100%; }
/* round 19 part 2: remove the background by itself */
.pe-bgrp { display: flex; flex-direction: column; gap: 6px; }
.pe-bgrt { font-size: var(--fs-sm); color: var(--ink); }
.pe-cutacts.pe-bgra { margin-bottom: 0; }
/* round 19e: Remove BG progress without download words: spinner, step, expected time */
.pe-bgrh { display: flex; align-items: center; gap: var(--sp-2, 8px); }
.pe-spin-l { width: 18px; height: 18px; border-width: 2.5px; flex: 0 0 auto; vertical-align: middle; }
.pe-bgrw { font-size: var(--fs-meta); color: var(--muted); }

.pe-pop.is-menu { padding: 6px; gap: 0; border-radius: 12px; min-width: 220px; }
.pe-cm { display: flex; flex-direction: column; }
.pe-cmi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; white-space: nowrap; cursor: pointer; }
.pe-cmi:hover, .pe-cmi:focus-visible { background: var(--surface-2); outline: none; }
.pe-cmi:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.pe-cmic { flex: 0 0 auto; display: inline-flex; color: var(--muted); }
.pe-cmt { flex: 1 1 auto; }
.pe-cmk { flex: 0 0 auto; margin-left: 16px; color: var(--muted); font: inherit; font-size: var(--fs-label); }
.pe-cmsep { display: block; height: 1px; margin: 4px 6px; background: var(--line); }
.pe-sw2.is-none { background: repeating-conic-gradient(#cbd5e1 0% 25%, #fff 0% 50%) 0 0 / 8px 8px !important; }
.pe .pe-zpill .pe-zfit { width: auto; min-width: 36px; padding: 0 8px; font: inherit; font-size: var(--fs-label); font-weight: 600; }
.pe-zfit[aria-pressed="true"] { color: var(--brand); }
.pe-npbox .pe-menu { margin: 0 -6px; }
.pe-npbox .pe-mi { padding: 8px 10px; }
.pe-phl .pe-rszb { flex: 0 0 auto; }
.pe-pfrom { display: flex; flex-direction: column; gap: 6px; }
/* round 29 (owner): the frame library, every frame drawn by our own code */
.pe-frlib { display: flex; flex-direction: column; gap: 16px; }
.pe-frg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pe-frb { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 7px 6px 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.pe-frb:hover { border-color: var(--brand); transform: translateY(-1px); }
.pe-frb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-frt { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.pe-frt img { max-width: 86%; max-height: 86%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(15,23,42,.16)); }
.pe-frn { max-width: 100%; font-size: 11.5px; font-weight: 500; line-height: 1.2; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { .pe-frb { transition: none; } }
/* round 30 (owner): the Photos search part stays on top while the photos scroll */
.pe-libhd { position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; background: var(--surface); }
.pe-libhd .pe-intro { margin-top: 14px; }
/* round 31 (owner): layers can be dragged in the list; "Page N of M" stays, only the name is the rename button; Custom size opens on a click */
.pe-lgrip { flex: 0 0 auto; display: inline-flex; width: 14px; margin-left: 2px; color: var(--muted); opacity: .55; cursor: grab; }
.pe-lgrip svg { width: 14px; height: 14px; }
.pe-li { touch-action: pan-y; }
.pe-layers { container: pelay / inline-size; }
@container pelay (max-width: 200px) { .pe-li { gap: 2px; } .pe-lic { width: 36px; } .pe-lpick { padding: 0 2px; } .pe-lpick canvas { width: 32px; height: 32px; } }
.pe-li:hover .pe-lgrip { opacity: 1; }
.pe-li.is-lock .pe-lgrip { opacity: .2; cursor: not-allowed; }
.pe-layers { position: relative; }
.pe-layers.is-sorting .pe-li { transition: transform .18s cubic-bezier(.2, .7, .3, 1); }
.pe-layers.is-sorting .pe-li.is-moving { visibility: hidden; transition: none; }
.pe-lslot { position: absolute; left: 0; right: 0; border: 2px dashed color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, transparent); box-sizing: border-box; pointer-events: none; transition: top .18s cubic-bezier(.2, .7, .3, 1); }
.pe-lslot::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--brand); }
.pe-lghost { position: fixed; z-index: 2147483000; margin: 0; list-style: none; box-sizing: border-box; pointer-events: none; cursor: grabbing; border-color: var(--brand); background: var(--surface); box-shadow: 0 14px 30px rgba(15, 23, 42, .22), 0 3px 8px rgba(15, 23, 42, .12); transform: scale(1.02) rotate(-1deg); opacity: .93; }
.pe-lghost.is-landing { transition: top .16s ease, left .16s ease, transform .16s ease, box-shadow .16s ease; transform: none; box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
.pe-li.is-dropped { animation: pe-ldrop .7s ease; }
@keyframes pe-ldrop { 0% { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); } 100% { background: var(--surface); } }
.pe-lgrip { touch-action: none; }
@media (prefers-reduced-motion: reduce) { .pe-layers.is-sorting .pe-li, .pe-lslot, .pe-lghost.is-landing { transition: none; } .pe-lghost { transform: none; } .pe-li.is-dropped { animation: none; } }
.pe-pnumt { font-weight: 600; white-space: nowrap; }
@container tool (width <= 22.5rem) { /* round 70 (owner Health Check, rule 151): on a narrow tool box the page head and the zoom pill wrap instead of being cut */
  .pe .pe-phd { flex-wrap: wrap; row-gap: 2px; min-width: 0; max-width: 100%; }
  .pe .pe-phd > .pe-phl { flex: 1 1 100%; row-gap: 2px; }
  .pe .pe-phl > .pe-pnum { flex: 1 1 2.75rem; }
  .pe .pe-phl > .pe-pnumt { flex: 0 0 auto; max-width: 100%; white-space: normal; }
  .pe .pe-pacts { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .pe .pe-zpill { left: 8px; right: 8px; transform: none; width: fit-content; max-width: calc(100% - 16px); margin-inline: auto; flex-wrap: wrap; justify-content: center; border-radius: 18px; }
}
.pe-npc { display: flex; flex-direction: column; gap: 10px; }
/* round 33 (owner): Transparency + Blend in the bar */
.pe-trb .pe-trv { margin-left: 2px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.pe-trb.is-set > svg { color: var(--brand); }
.pe-trbox { min-width: 280px; }
.pe-selbar .btn.is-ic > span { display: none; }
.pe-selbar .btn.is-ic { padding-inline: 8px; }
/* round 34 (owner): a clear, friendly wait while icons or photos load */
.pe-skel { display: block; border-radius: 10px; aspect-ratio: 1; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: pe-shim 1.3s ease-in-out infinite; }
@keyframes pe-shim { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.pe-wait { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); font-size: var(--fs-sm); line-height: 1.35; text-align: center; }
.pe-wdots { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.pe-wdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pe-wdot 1s ease-in-out infinite; }
.pe-wdots i:nth-child(2) { animation-delay: .15s; } .pe-wdots i:nth-child(3) { animation-delay: .3s; }
@keyframes pe-wdot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pe-skel, .pe-wdots i { animation: none; } }
/* round 34: 130 photo shapes in named groups, 4 to a row, no names under them (the tooltip says it) */
.pe-frg.is-sh { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pe-frg .pe-frsg { grid-column: 1 / -1; margin: 10px 0 0; font-size: var(--fs-label); font-weight: 600; color: var(--muted); }
.pe-frg .pe-frsg:first-child { margin-top: 0; }
.pe-frg.is-sh .pe-frb { padding: 5px; }
.pe-frg.is-sh .pe-frt { aspect-ratio: 1; }
.pe-mb canvas { width: 44px; height: 44px; filter: drop-shadow(0 1px 2px rgba(15,23,42,.22)); }
/* round 44 (owner): Thumbnail layouts and the small previews */
.pe-thl .pe-frt { aspect-ratio: 16 / 9; }
.pe-thl .pe-frt img { max-width: 100%; max-height: 100%; filter: none; }
.pe-thl .pe-frb[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pe-thpw { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pe-thpv { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 10px; background: var(--surface-2); }
.pe-thpv.pe-thps2 { width: 168px; border-radius: 6px; }
/* round 45 (owner): a page that takes a dragged layer */
.pe-pblk.is-drop .pe-pbody { box-shadow: 0 0 0 3px var(--brand); border-radius: var(--pe-r); }
/* round 47 (owner): a layer dragged to another page floats above everything */
.pe-ghost { position: fixed; z-index: 2147483000; pointer-events: none; opacity: .92; filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .35)); }
/* round 48 (owner): the start screen has two tabs: Pick a size | Edit your own photo */
/* round 49 (owner): a compact segmented switch in the middle, not two huge bars; the brand pill slides to the chosen side */
.pe-start { container: pestart / inline-size; }
.pe-stabs { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: max-content; max-width: 100%; margin-inline: auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); isolation: isolate; }
.pe-stabs::before { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--brand); box-shadow: 0 2px 8px rgba(79, 70, 229, .35); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.pe-stabs:has(#pe-tab-own[aria-selected="true"])::before { transform: translateX(100%); }
.pe-stab { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14.5px; white-space: nowrap; cursor: pointer; transition: color .2s ease; }
.pe-stab:hover { color: var(--brand); }
.pe-stab[aria-selected="true"], .pe-stab[aria-selected="true"]:hover { color: #FFFFFF; }
.pe-stab:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.pe-stab svg { flex: none; width: 18px; height: 18px; }
.pe-sts { display: none; }
@container pestart (max-width: 420px) { .pe-stabs { width: 100%; } .pe-stab { padding: 0 12px; } .pe-stl { display: none; } .pe-sts { display: inline; } }
@container pestart (max-width: 270px) { .pe-stab { gap: 0; padding: 0 8px; } .pe-stab svg { display: none; } }
@media (prefers-reduced-motion: reduce) { .pe-stab, .pe-stabs::before { transition: none; } }
/* round 52 (owner): the many-photos note is a calm card above the zoom bar in the editor's own look (not the site toast), it stays until closed */
.pe-memb { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(520px, calc(100% - 24px)); padding: 8px 6px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--pe-card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pe-membi { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 999px; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.pe-membt { margin: 0; font-size: 13.5px; line-height: 1.45; font-weight: 400; color: var(--ink); }
.pe-membt b { font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .pe-memb { animation: pe-membin .25s ease-out; } }
@keyframes pe-membin { from { opacity: 0; transform: translate(-50%, 6px); } }
/* round 62 (owner): the drop box has the same height as HEIC to JPG's (17.5rem = 280 px; taller only when its content needs it), see the min-height of .pe-drop above.
   The size limit in the save box looks the same as HEIC to JPG's. */
.pe-sl.pe-dim { opacity: .55; }
.pe-lim { display: flex; flex-direction: column; gap: var(--gap-label); }
.pe-limt { display: flex; align-items: center; gap: var(--sp-1); }
.pe-limt .pe-rl { margin: 0; cursor: default; }
.pe-limbx { display: inline-grid; place-items: center; margin: calc(var(--sp-3) * -1) 0 calc(var(--sp-3) * -1) calc(var(--sp-3) * -1); padding: var(--sp-3); cursor: pointer; }
.pe-limbx input { width: var(--sp-5); height: var(--sp-5); margin: 0; accent-color: var(--brand); cursor: pointer; }
.pe-limb { display: flex; flex-direction: column; gap: var(--gap-item); }
.pe-limb[hidden] { display: none; }
.pe-limr { display: flex; gap: var(--gap-min); max-width: 16rem; }
.pe-limr #pe-limn { flex: 1; min-width: 0; }
.pe-limr #pe-limu { flex: none; width: auto; }
.pe-limq { display: flex; flex-wrap: wrap; gap: var(--gap-min); }
.pe-limc { min-height: var(--h-btn-sm); padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.pe-limc:hover, .pe-limc:focus-visible { border-color: var(--brand); }
.pe-limc[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.pe-limh { display: flex; flex-direction: column; gap: var(--sp-1); }
.pe-limest { color: var(--ink); font-weight: 600; }
.pe-limest:empty { display: none; }

/* rule 151: a very narrow size card puts its name under the picture instead of squeezing it */
.pe .pe-size { flex-wrap: wrap; }
.pe .pe-size > .pe-szt { flex: 1 1 4.5rem; }

/* round 75 (owner): opening photos is shown in the drop box: a count, a bar that fills, one tile per photo (its own small picture as soon as it is open);
   the box border moves (marching dashes) while it works. Inside the editor the dark pill shows the count, a small bar and the last photo. */
.pe-drop.is-busy { cursor: progress; border-style: solid; border-color: transparent;
  background: linear-gradient(90deg, var(--brand) 50%, transparent 0) 0 0 / 14px 2px repeat-x border-box,
    linear-gradient(90deg, var(--brand) 50%, transparent 0) 0 100% / 14px 2px repeat-x border-box,
    linear-gradient(0deg, var(--brand) 50%, transparent 0) 0 0 / 2px 14px repeat-y border-box,
    linear-gradient(0deg, var(--brand) 50%, transparent 0) 100% 0 / 2px 14px repeat-y border-box,
    color-mix(in srgb, var(--brand) 6%, var(--surface)) padding-box;
  animation: pe-ants .8s linear infinite; }
@keyframes pe-ants { to { background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px, 0 0; } }
.pe-drop.is-busy > .pe-dropa, .pe-drop.is-busy > .pe-dropt, .pe-drop.is-busy > .pe-drops { display: none; }
.pe-prog { display: flex; flex-direction: column; gap: var(--sp-3); width: 100%; max-width: 34rem; text-align: left; }
.pe-prog[hidden] { display: none; }
.pe-progh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }
.pe-progh b { font-size: var(--fs-h3); color: var(--ink); }
.pe-progc { font-size: var(--fs-label); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.pe-progbar { position: relative; display: block; height: 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); overflow: hidden; }
.pe-progbar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 70%, #fff), var(--brand)); transition: width .35s ease; overflow: hidden; }
.pe-progbar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: pe-sheen 1.4s ease-in-out infinite; }
@keyframes pe-sheen { to { transform: translateX(100%); } }
.pe-progs { font-size: var(--fs-label); color: var(--muted); overflow-wrap: anywhere; min-height: 1.4em; }
.pe-progtl { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.pe-pt { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted); overflow: hidden; }
.pe-pt canvas { display: block; width: 100%; height: 100%; }
.pe-pt.is-wait { background: linear-gradient(100deg, var(--surface) 30%, color-mix(in srgb, var(--brand) 10%, var(--surface)) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: pe-wait 1.6s ease-in-out infinite; }
@keyframes pe-wait { from { background-position: 100% 0; } to { background-position: 0 0; } }
.pe-pt.is-now { border: 2px solid var(--brand); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); animation: pe-now 1s ease-in-out infinite alternate; }
@keyframes pe-now { to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 8%, transparent); } }
.pe-pt.is-ok { border-color: transparent; box-shadow: var(--shadow); animation: pe-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.pe-pt.is-ok::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.9' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; box-shadow: 0 0 0 2px var(--surface); }
@keyframes pe-pop { from { transform: scale(.6); opacity: 0; } }
.pe-pt.is-bad { background: color-mix(in srgb, var(--danger, #DC2626) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger, #DC2626) 45%, var(--line)); color: var(--danger, #DC2626); font-size: 18px; }
.pe-pt.pe-ptmore { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-size: 13px; }
.pe-busy.is-prog { display: flex; align-items: center; gap: var(--sp-2); padding-left: var(--sp-2); }
.pe-busy.is-prog[hidden] { display: none; }
.pe-bth { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 60%, transparent); }
.pe-bth canvas { display: block; width: 100%; height: 100%; }
.pe-btx { font-variant-numeric: tabular-nums; }
.pe-bbar { position: relative; flex: 0 0 4.5rem; height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 25%, transparent); overflow: hidden; }
.pe-bbar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand-soft); transition: width .35s ease; }
@media (prefers-reduced-motion: reduce) { .pe-drop.is-busy, .pe-progbar > i::after, .pe-pt.is-wait, .pe-pt.is-now, .pe-pt.is-ok { animation: none; } .pe-progbar > i, .pe-bbar > i { transition: none; } }
.pe-pdock { position: sticky; top: calc(var(--pe-top, 0px) + 8px); z-index: 6; height: 0; margin-bottom: -10px; }
/* round 76 (owner): the type of the file a page came from (JPG, PNG, HEIC...), shown beside its name, never edited */
.pe-phl > .pe-pext { flex: 0 0 auto; }
.pe-pext { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em; line-height: 1.5; }
.pe-wsdark .pe-pext { color: #CBD5E1; border-color: rgba(255, 255, 255, .22); background: transparent; }
/* round 78 (owner): the fast way to save many photos */
.pe-best.pe-fast { background: #DBEAFE; color: #1E40AF; }
:root[data-theme="dark"] .pe-best.pe-fast { background: #1E3A8A; color: #BFDBFE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pe-best.pe-fast { background: #1E3A8A; color: #BFDBFE; } }
/* round 79 (owner): the save progress panel above the buttons, so a long save is seen and never feels stuck */
.pe-dinfo:empty { display: none; }
.pe-sprog { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-card); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 8%, transparent); }
.pe-sph { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.pe-sring { --p: 0; position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), color-mix(in srgb, var(--brand) 16%, var(--surface)) 0); }
.pe-sring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.pe-sring > b { position: relative; font-size: 12px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.pe-sring.is-ind { background: conic-gradient(var(--brand) 0 25%, color-mix(in srgb, var(--brand) 16%, var(--surface)) 0); animation: pe-spin .9s linear infinite; }
@keyframes pe-spin { to { transform: rotate(1turn); } }
.pe-spx { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.pe-spt { font-size: var(--fs-body, 15px); color: var(--ink); overflow-wrap: anywhere; }
.pe-sps { font-size: var(--fs-label); color: var(--muted); overflow-wrap: anywhere; }
.pe-spc { flex: none; padding: 4px 10px; border-radius: var(--r-pill); background: var(--brand); color: #fff; font-size: var(--fs-label); font-weight: 700; font-variant-numeric: tabular-nums; }
.pe-spc[hidden] { display: none; }
.pe-sprog .pe-progbar.is-ind > i { width: 35%; animation: pe-slide 1.2s ease-in-out infinite; }
@keyframes pe-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.pe-sptl { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-sptl .pe-pt { width: 40px; height: 40px; border-radius: 8px; font-size: 11px; }
.pe-sptl .pe-pt.is-ok::after { width: 14px; height: 14px; right: 2px; bottom: 2px; }
.pe-sptl .pe-pt.is-wait canvas { opacity: .35; filter: grayscale(1); }
.pe-spf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-label); color: var(--muted); font-variant-numeric: tabular-nums; }
.pe-spl { font-weight: 700; color: var(--brand); }
.pe-spl[hidden] { display: none; }
/* the spoken page count; the theme's own class may be missing in a frame */
.pe-sprog .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
@media (prefers-reduced-motion: reduce) { .pe-sring.is-ind, .pe-sprog .pe-progbar.is-ind > i { animation: none; } }
/* round 81 (owner): on a touch screen a finger may scroll the page over the picture in Select (a layer moves after touch and hold);
   the save box keeps its progress panel and Save / Copy / Print in sight at the bottom */
.pe-stagew.pe-tpan, .pe-stagew.pe-tpan #pe-stage { touch-action: pan-y; }
#pe-stage { -webkit-touch-callout: none; }
.pe-dfoot { position: sticky; bottom: calc(-1 * var(--pad-box, 16px)); z-index: 2; display: flex; flex-direction: column; gap: var(--gap-item); margin: 0 calc(-1 * var(--pad-box, 16px)); padding: var(--sp-3) var(--pad-box, 16px) var(--pad-box, 16px); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -12px 20px -16px rgba(15, 23, 42, .35); }
/* round 82 (owner): phones. Sliders let a vertical swipe scroll the page; the editor's buttons and labels are never text-selected or
   given a long-press callout by a finger (boxes you type in still are); typing boxes use 16px on touch screens so phones never zoom in */
.pe-range { touch-action: pan-y; }
.pe-ed { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pe-ed input, .pe-ed textarea, .pe-ed select, .pe-ed [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
@media (pointer: coarse) { .pe input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), .pe textarea, .pe select { font-size: max(16px, 1em); } }
/* round 85 (owner): under the open page, one smart line says how many pages follow (small pictures of the next ones, a gently moving arrow);
   a click scrolls to the next page. Only where the page list scrolls by itself (computer layout); phones show every page one under the other */
.pe-pblk.is-on .pe-pmore { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); width: fit-content; max-width: 100%; margin: 6px auto 0; padding: 4px 14px 4px 6px; min-height: 34px; border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); color: var(--ink); font: inherit; font-size: var(--fs-label); cursor: pointer; box-shadow: 0 4px 14px -8px color-mix(in srgb, var(--brand) 60%, transparent); transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.pe-pblk.is-on .pe-pmore[hidden] { display: none; }
.pe-pblk.is-on .pe-pmore:hover { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); border-color: var(--brand); transform: translateY(-1px); }
.pe-pblk.is-on .pe-pmore:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-pmore b { color: var(--brand); font-weight: 700; }
.pe-pmt { overflow-wrap: anywhere; }
.pe-pmth { display: inline-flex; flex: none; }
.pe-pmth > canvas, .pe-pmth > .pe-pmth0 { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .25); background: var(--surface-2); object-fit: cover; }
.pe-pmth > * + * { margin-left: -8px; }
.pe-pmth0 { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.pe-pmar { display: inline-flex; color: var(--brand); animation: pe-pmbob 1.6s ease-in-out infinite; }
@keyframes pe-pmbob { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .pe-pmar { animation: none; } .pe-pblk.is-on .pe-pmore { transition: none; } }

/* round 87 (owner): Outline panel, ready outlines wrap */
.pe .pe-ollooks { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
/* round 88 (owner): Photos from Unsplash + Pexels: source chips, "Photos provided by" line, the photographer under each photo */
.pe .pe-phlib .pe-chips[hidden] { display: none; }
.pe-phby { margin: 0; }
.pe-phby a { color: inherit; font-weight: 600; }
.pe-phi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* round 88b (owner: every Unsplash / Pexels rule): "Photo by <name> on <source>" under each photo and on top of the panel while a credited photo is chosen */
.pe .pe-phg.pe-phg-cr { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr)); }
.pe .pe-crd { margin: 0; font-size: var(--fs-tag); line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.pe .pe-crd a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pe .pe-crd a:hover, .pe .pe-crd a:focus-visible { color: var(--brand); }
.pe .pe-opt > .pe-crd { padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3); }

/* (Mother 2026-10-25, owner "চালাও": Design Check findings, contrast 4.5:1 / tap targets 24 px) */
.pe-dropt b{color:var(--brand-ink)}
/* round 94: Thumbnail layouts v2: the photo-count filter, number boxes with - / +, columns x rows */
.pe-thf { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--gap-item, 12px); }
.pe-thfb { min-height: 32px; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm, 13px); cursor: pointer; }
.pe-thfb:hover { border-color: var(--brand); }
.pe-thfb[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pe-thn { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.pe-thnc { display: flex; align-items: center; gap: 6px; }
.pe-thni { width: 5.5rem; min-width: 0; height: 36px; text-align: center; }
.pe-thnb { min-width: 36px; padding: 0; justify-content: center; }
.pe-thcr { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px 16px; }
.pe-thone { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pe-tpg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pe-tpg .pe-frb { padding: 4px 4px 6px; }
.pe-tpg .pe-frt { aspect-ratio: 16 / 9; border-radius: 6px; }
.pe-tpg .pe-frt img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; filter: none; }
.pe-tpg .pe-frt.is-wait img { visibility: hidden; }
.pe-tpg .pe-frt.is-wait { background: linear-gradient(110deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: pe-tpw 1.2s linear infinite; }
@keyframes pe-tpw { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pe-tpg .pe-frt.is-wait { animation: none; } }
.pe-tsbox { display: flex; flex-direction: column; gap: 10px; }
.pe-tsg2 { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.pe-ts2 { height: auto; aspect-ratio: 12 / 5; padding: 0; overflow: hidden; background: #1F2937; }
.pe-ts2 img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pe-ts2.is-wait img { visibility: hidden; }
.pe-ts2.is-wait { background: linear-gradient(110deg, #1F2937 30%, #334155 50%, #1F2937 70%); background-size: 200% 100%; animation: pe-tpw 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pe-ts2.is-wait { animation: none; } }
.pe-fo .pe-fsm { max-width: 55%; overflow: hidden; font-style: normal; font-size: 14px; color: var(--muted); }
.pe-fmore { padding: 10px 12px; font-size: var(--fs-meta); color: var(--muted); }
.pe-fnote { margin: 0; font-size: var(--fs-meta); }
.pe-fnote a { color: inherit; }
.pe-fp > select { flex: 0 0 auto; height: 40px; }
