/* CommunityHub Photo Editor 1.2.1: scoped; no change to Theme or global rail widgets */
.ch-photo-editor{--pe-ink:#eff6ff;--pe-muted:#abc0d6;--pe-line:#385069;--pe-panel:#122136;--pe-stage:#07111f;box-sizing:border-box;max-width:1320px;min-width:0;margin:0 auto;padding:clamp(10px,1.6vw,22px);color:var(--pe-ink);font-family:inherit}
.ch-photo-editor *{box-sizing:border-box}.ch-photo-editor [hidden]{display:none!important}
.ch-pe-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;padding:24px clamp(18px,3.5vw,34px);border:1px solid #375d80;border-radius:22px;background:radial-gradient(circle at 85% 0%,rgba(81,179,252,.21),transparent 42%),linear-gradient(125deg,#142f4e,#0b1526)}
.ch-pe-heading h2{font-size:clamp(27px,3.8vw,43px)!important;color:#fff!important;margin:5px 0!important;line-height:1.13!important}.ch-pe-heading p{color:#b8d1e7!important;font-size:13px!important;margin:6px 0 0!important;line-height:1.5!important}.ch-pe-kicker{color:#8adbff;font-size:11px;font-weight:900;letter-spacing:.13em}.ch-pe-heading>a{white-space:nowrap;padding:10px 15px;border:1px solid #51718d;border-radius:10px;color:#d4eafc!important;text-decoration:none!important;font-size:12px;font-weight:800}
.ch-pe-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(265px,330px);gap:16px;align-items:start}
.ch-pe-workspace,.ch-pe-tools{min-width:0;border:1px solid var(--pe-line);border-radius:20px;background:var(--pe-panel);padding:15px;box-shadow:0 12px 25px rgba(0,0,0,.1)}
.ch-pe-actions,.ch-pe-tool-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.ch-pe-actions{margin-bottom:13px}
.ch-photo-editor button,.ch-pe-button{cursor:pointer;border:1px solid #56718a;background:#1c344b;color:#e8f4ff!important;border-radius:10px;min-height:39px;padding:9px 12px;font-size:12px;font-weight:760;text-align:center;line-height:1.35;transition:background .14s ease}
.ch-photo-editor button:hover,.ch-pe-button:hover{background:#275071}.ch-photo-editor button:focus-visible,.ch-pe-button:focus-within{outline:3px solid #9bcfff;outline-offset:2px}
.ch-photo-editor button:disabled{opacity:.42;cursor:not-allowed}.ch-photo-editor .ch-pe-primary,.ch-pe-button.ch-pe-primary{background:#066fb8;color:#fff!important;border-color:#49baf8}
.ch-pe-canvas-stage{position:relative;display:flex;justify-content:center;align-items:center;min-height:clamp(280px,52vw,650px);max-height:78vh;overflow:hidden;border-radius:14px;border:1px solid #304964;background:linear-gradient(45deg,#0a1b2b 25%,#0d2134 25%,#0d2134 50%,#0a1b2b 50%,#0a1b2b 75%,#0d2134 75%);background-size:24px 24px}
.ch-pe-canvas-stage canvas{display:block;width:auto;height:auto;max-width:100%;max-height:min(72vh,630px);object-fit:contain;touch-action:auto;user-select:none}.ch-pe-canvas-stage canvas.is-cropping{touch-action:none;cursor:crosshair}
.ch-pe-empty{display:flex;flex-direction:column;align-items:center;gap:9px;max-width:290px;text-align:center;padding:25px;color:#cbdced}.ch-pe-empty>span{font-size:54px;opacity:.68}.ch-pe-empty strong{font-size:18px}.ch-pe-empty small{line-height:1.5;color:#9fb9cb}
.ch-pe-crop-selection{position:absolute;pointer-events:none;border:2px solid #fff;box-shadow:0 0 0 200vw rgba(0,0,0,.15),inset 0 0 0 1px rgba(0,0,0,.7);border-radius:2px}
.ch-pe-crop-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:11px;color:var(--pe-muted);font-size:12px}.ch-pe-crop-actions button[data-pe-action="apply-crop"]{background:#0b7788;color:#fff!important}
.ch-pe-feedback{margin:13px 4px 2px!important;color:var(--pe-muted)!important;font-size:12px!important;min-height:19px}.ch-pe-feedback.is-error{color:#ffc2c2!important}
.ch-pe-tabs{display:grid;grid-template-columns:repeat(var(--pe-tab-count,3),minmax(0,1fr));gap:6px;margin-bottom:16px}.ch-pe-tabs button{padding:9px 4px;min-width:0}.ch-pe-tabs button.is-selected{background:#0c6eae;border-color:#55c4f7;color:white!important}
.ch-pe-panel{display:grid;gap:15px}.ch-pe-panel h3{font-size:14px!important;font-weight:850!important;color:#fff!important;margin:8px 0 0!important;padding-bottom:8px;border-bottom:1px solid var(--pe-line)}
.ch-pe-panel>label{display:grid;gap:7px;font-size:12px;font-weight:720;color:var(--pe-ink)}.ch-pe-panel label output{float:right;color:#91ddff;font-size:12px;font-variant-numeric:tabular-nums}
.ch-pe-panel :is(input[type="text"],select,textarea){width:100%;min-width:0;border:1px solid #5a7187;border-radius:9px;background:#0e1b2b;color:#fff;min-height:39px;padding:8px 10px;font-size:13px}.ch-pe-panel input[type="range"]{width:100%;accent-color:#2bb0ed;cursor:pointer;min-height:27px}
.ch-pe-panel .ch-pe-check{display:flex;align-items:center;gap:9px}.ch-pe-check input{width:17px;height:17px;accent-color:#0b8fd4}
.ch-pe-panel .ch-pe-hint{font-size:12px!important;line-height:1.6!important;color:var(--pe-muted)!important;margin:0!important}.ch-pe-panel button.ch-pe-export{width:100%;font-size:14px;min-height:45px}
.ch-photo-guest{max-width:680px;margin:32px auto;padding:36px;border:1px solid #5c7f9d;border-radius:20px;background:#101e30;color:#f1f7ff}.ch-photo-guest h2{color:#fff!important}.ch-photo-guest a{display:inline-block;margin-top:14px;background:#066fb8;color:#fff;padding:12px 16px;border-radius:10px}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-photo-editor{--pe-ink:#1a3954;--pe-muted:#4b657e;--pe-line:#cad9e6;--pe-panel:#f9fbff;--pe-stage:#e5edf4}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-workspace,:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-tools{background:#f8fbff;border-color:#c3d5e4}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-panel h3{color:#15354d!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-photo-editor button:not(.ch-pe-primary),:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-button:not(.ch-pe-primary){background:#e7f0f8;border-color:#b7cad9;color:#1b415e!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-tabs button.is-selected{background:#166f9f;color:#fff!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-panel :is(input[type="text"],select,textarea){background:#fff;color:#1b354a;border-color:#a8c0d4}
@media(max-width:900px){.ch-pe-layout{grid-template-columns:1fr}.ch-pe-tools{order:2}.ch-pe-canvas-stage{min-height:320px}.ch-pe-panel{grid-template-columns:repeat(2,minmax(0,1fr))}.ch-pe-panel h3,.ch-pe-tool-row,.ch-pe-hint,.ch-pe-export{grid-column:1/-1}}
@media(max-width:560px){.ch-photo-editor{padding:0}.ch-pe-heading{border-radius:16px;padding:18px;align-items:flex-start}.ch-pe-heading>a{padding:8px}.ch-pe-workspace,.ch-pe-tools{padding:10px;border-radius:14px}.ch-pe-canvas-stage{min-height:260px;max-height:58vh}.ch-pe-canvas-stage canvas{max-height:55vh}.ch-pe-panel{grid-template-columns:1fr}.ch-pe-actions>*{flex:1 1 auto}.ch-pe-crop-actions button{flex:1}.ch-pe-tool-row button{flex:1 1 45%}}
@media(prefers-reduced-motion:reduce){.ch-photo-editor button{transition:none!important}}

/* R564 opt-in Vault bridge: private collection copy; no automatic uploads. */
.ch-pe-vault-bridge{display:grid;gap:10px;padding:15px;border:1px solid #3e7d83;border-radius:13px;background:linear-gradient(120deg,rgba(7,108,100,.2),rgba(15,65,85,.12))}
.ch-pe-vault-bridge h3{margin:0!important;padding:0!important;border:0!important;font-size:14px!important}
.ch-pe-vault-bridge p{margin:0!important;color:var(--pe-muted)!important;font-size:12px!important;line-height:1.6!important}
.ch-photo-editor .ch-pe-vault-save{background:#08675d;color:#fff!important;border-color:#60cfb8;min-height:45px;font-weight:850}
.ch-photo-editor .ch-pe-vault-save:hover{background:#095e56}
.ch-pe-vault-bridge>a{color:#93e6d2!important;font-size:13px;font-weight:850;text-decoration:underline!important;text-underline-offset:3px}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-vault-bridge{background:#effaf6;border-color:#95cfc1}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-photo-editor .ch-pe-vault-save{background:#07665c;color:#fff!important;border-color:#08786d}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-pe-vault-bridge>a{color:#145c52!important}
@media(max-width:900px){.ch-pe-vault-bridge{grid-column:1/-1}}

/* R564 real-Theme audit: the Theme page-content typography has stronger global
   rules than tool CSS; restore readable scoped editor text in both modes. */
.ch-theme-page-content .ch-photo-editor .ch-pe-heading h2{color:#fff!important}
.ch-theme-page-content .ch-photo-editor .ch-pe-heading p{color:#c6d9eb!important}
.ch-theme-page-content .ch-photo-editor .ch-pe-panel h3,
.ch-theme-page-content .ch-photo-editor .ch-pe-vault-bridge h3{color:#f7faff!important}
.ch-theme-page-content .ch-photo-editor .ch-pe-panel > label,
.ch-theme-page-content .ch-photo-editor .ch-pe-panel .ch-pe-check,
.ch-theme-page-content .ch-photo-editor .ch-pe-crop-actions{color:var(--pe-ink)!important}
.ch-theme-page-content .ch-photo-editor .ch-pe-feedback,
.ch-theme-page-content .ch-photo-editor .ch-pe-panel .ch-pe-hint,
.ch-theme-page-content .ch-photo-editor .ch-pe-vault-bridge p {color:var(--pe-muted)!important}
.ch-theme-page-content .ch-photo-editor .ch-pe-panel :is(input[type="text"],select,textarea){color:#fff!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-panel h3,
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-vault-bridge h3{color:#15354d!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-panel :is(input[type="text"],select,textarea){color:#1b354a!important}

/* The file-picker is a label, so page-level label colors must not darken its filled blue control. */
.ch-theme-page-content .ch-photo-editor label.ch-pe-button.ch-pe-primary,
.ch-theme-page-content .ch-photo-editor .ch-pe-primary{color:#fff!important;-webkit-text-fill-color:#fff!important}
/* R564 Light Mode input and selected-action recovery: Theme generic form/button
   rules were out-specificing the editor's surface palette. */
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-panel :is(input[type="text"],select,textarea){
  background-color:#fff!important;
  color:#1b354a!important;
  -webkit-text-fill-color:#1b354a!important;
  border-color:#a8c0d4!important;
}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-panel label output {color:#145b83!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor .ch-pe-tabs button.is-selected {
  background:#166f9f!important;
  border-color:#3291bb!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light)
 .ch-theme-page-content .ch-photo-editor button.ch-pe-vault-save {
  background:#07665c!important;
  border-color:#4ba999!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* R565 Photo publishing and one-tap looks. Editor-local styling only. */
.ch-pe-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.ch-pe-presets button{min-width:0;font-size:12px;padding:9px 5px}
.ch-photo-editor .ch-pe-presets button.is-selected{background:#165f85;border-color:#68d4e8;color:#fff!important;-webkit-text-fill-color:#fff!important}
.ch-photo-editor .ch-pe-post-panel{gap:13px}
.ch-photo-editor .ch-pe-post-panel textarea{resize:vertical;min-height:86px;line-height:1.5}
.ch-photo-editor .ch-pe-post-panel button.ch-pe-publish{background:#076e69;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:#44cabd;font-weight:850;min-height:48px}
.ch-photo-editor .ch-pe-post-panel button.ch-pe-publish:hover{background:#085d59}
.ch-photo-editor .ch-pe-post-panel .ch-pe-post-link{display:inline-block;color:#93e6d2!important;font-weight:800;text-underline-offset:3px}
.ch-photo-editor .ch-pe-post-panel .ch-pe-post-link[hidden]{display:none!important}
.ch-photo-editor .ch-pe-post-panel .ch-pe-hint{grid-column:1/-1}
.ch-theme-page-content .ch-photo-editor .ch-pe-post-panel textarea{background:#0e1b2b;color:#fff!important;-webkit-text-fill-color:#fff!important;border:1px solid #5a7187}
.ch-theme-page-content .ch-photo-editor .ch-pe-post-panel .ch-pe-check{color:var(--pe-ink)!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-theme-page-content .ch-photo-editor .ch-pe-post-panel textarea{background:#fff!important;color:#1b354a!important;-webkit-text-fill-color:#1b354a!important;border-color:#a8c0d4}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-photo-editor .ch-pe-presets button.is-selected{background:#166f9f!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:#287c9c!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-theme-page-content .ch-photo-editor .ch-pe-post-panel button.ch-pe-publish{background:#076e69!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:#319a8a!important}
:is(html[data-ch-theme-mode="light"] body,body.ch-theme-mode-light,body.ch-light-mode,body.ch-theme-light) .ch-photo-editor .ch-pe-post-panel .ch-pe-post-link{color:#125e56!important}
@media(max-width:900px){.ch-pe-presets{grid-column:1/-1}}
@media(max-width:560px){.ch-pe-presets{grid-template-columns:repeat(2,minmax(0,1fr))}.ch-pe-tabs button{font-size:12px}}
