/* EFEMERNY editor-system v540 — canonical editor visual contract.
   v544 unifies switch skins; v545 removes superseded field/button declarations.
   Reuses the global palette from design-tokens.css. No artwork/reader selectors.
   Later editors opt in with .ef-editor and .ef-* component classes. */
:root {
  --ef-editor-drawer-width: 476px;
  --ef-editor-nav-width: 60px;
  --ef-editor-padding: 18px;
  --ef-editor-field-bg: color-mix(in srgb,var(--ef-white) 3%,transparent);
  --ef-editor-field-bg-focus: color-mix(in srgb,var(--ef-white) 4.5%,transparent);
  --ef-editor-quiet-bg: color-mix(in srgb,var(--ef-white) 2%,transparent);
  --ef-editor-radius: 11px;
  --ef-editor-snap: cubic-bezier(.2,.8,.2,1);
  --ef-editor-quick: 180ms;
  --ef-editor-smooth: 260ms;
  /* Canonical component colors: visually identical to the approved v11. */
  --ef-editor-switch-off: #282231;
  --ef-editor-knob-off: #b9a9c9;
  --ef-editor-range-rail: #322a3d;
  --ef-editor-range-thumb-ring: #211a2b;
}
/* Reusable primitives: no selectors for unaffiliated site forms. */
.ef-editor {color:var(--ef-text);font:400 16px/1.5 var(--ef-font-ui);}
.ef-editor .ef-editor-section {min-width:0;margin-block:18px 22px;}
.ef-editor .ef-editor-heading {color:var(--ef-text);font-weight:600;line-height:1.3;margin:0 0 14px;}
.ef-editor .ef-editor-field {display:grid;gap:8px;min-width:0;margin-bottom:14px;font:400 15px/1.5 var(--ef-font-ui);color:var(--ef-quiet);}
/* v545: native fields and button paint live only in the v537 primitive block below.
   Older duplicate selectors removed after a computed-style comparison. */
.ef-editor .ef-editor-check-row {display:flex;align-items:center;gap:11px;min-height:44px;padding:9px 10px;border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-quiet-bg);cursor:pointer;color:var(--ef-quiet);}
.ef-editor .ef-editor-check-row input[type=checkbox] {flex:none;}
.ef-editor .ef-editor-switch-row {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;cursor:pointer;}
.ef-editor .ef-editor-range {display:grid;gap:8px;min-width:0;}
.ef-editor .ef-editor-range-head {display:flex;justify-content:space-between;align-items:center;gap:10px;color:var(--ef-quiet);}
.ef-editor .ef-editor-range-value {padding:3px 9px;border-radius:8px;background:var(--ef-editor-quiet-bg);font-variant-numeric:tabular-nums;}
.ef-editor .ef-editor-icon-button {display:grid;place-items:center;flex:none;width:40px;height:40px;border:0;border-radius:10px;background:transparent;color:var(--ef-quiet);cursor:pointer;transition:color var(--ef-editor-quick) ease,background var(--ef-editor-quick) ease,transform var(--ef-editor-quick) ease;}
.ef-editor .ef-editor-icon-button:hover {background:var(--ef-hover);color:var(--ef-text);}
.ef-editor .ef-editor-icon-button:active {transform:scale(.94);}
.ef-editor .ef-editor-icon-button:focus-visible {outline:2px solid var(--ef-focus-ring);outline-offset:2px;}
/* Profile adapter: matches approved isolated design v11 without changing profile artwork. */
@media (min-width:640px) {
  body.profile-page .profile-customizer {
    width:min(var(--ef-editor-drawer-width),100vw);
    grid-template-columns:minmax(0,1fr) var(--ef-editor-nav-width);
  }
  body.profile-page .profile-customizer > header {grid-column:1;grid-row:1;padding:18px var(--ef-editor-padding) 8px;}
  body.profile-page .profile-customizer .profile-editor-tabs {
    grid-column:2;grid-row:1/-1;align-items:center;gap:5px;
    padding:76px 6px 14px;border-right:0;
    border-left:1px solid color-mix(in srgb,var(--ef-white) 9%,transparent);
  }
  body.profile-page .profile-customizer .profile-editor-body {grid-column:1;grid-row:2;padding:10px var(--ef-editor-padding) 18px;min-width:0;}
  body.profile-page .profile-customizer .profile-editor-footer {grid-column:1;grid-row:3;padding:10px var(--ef-editor-padding) 14px;min-width:0;}
  body.profile-page .profile-customizer .profile-editor-tabs > button {
    display:grid;place-items:center;flex:none;width:46px;height:46px;min-height:46px;padding:0;border-radius:12px;
  }
}
body.profile-page .profile-customizer {box-shadow:none;border:0;border-radius:0;}
body.profile-page .profile-customizer h2 {font-size:22px;}
body.profile-page .profile-customizer .profile-editor-tabs > button > span {
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  white-space:nowrap;clip:rect(0,0,0,0);clip-path:inset(50%);border:0;
}
body.profile-page .profile-customizer .profile-editor-tabs > button > .ui-icon {
  width:24px;height:24px;flex:none;display:block;
  transition:transform var(--ef-editor-smooth) var(--ef-editor-snap),color var(--ef-editor-quick) ease;
}
body.profile-page .profile-customizer .profile-editor-tabs > button:is(:hover,:focus-visible) > .ui-icon {transform:scale(1.06);}
body.profile-page .profile-customizer .profile-editor-pane-heading {margin-bottom:16px;}
body.profile-page .profile-customizer .profile-editor-section-title {margin-top:18px;margin-bottom:10px;}
body.profile-page .profile-customizer .profile-editor-body label:not(.profile-switch) {margin-bottom:14px;}
body.profile-page .profile-customizer .profile-editor-body :is(input:not([type=range]):not([type=checkbox]):not([type=color]):not([type=file]),textarea,select) {
  border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-field-bg);
}
body.profile-page .profile-customizer .profile-editor-body textarea {min-height:104px;}
body.profile-page .profile-customizer .profile-editor-body :is(input:not([type=range]):not([type=checkbox]):not([type=color]):not([type=file]),textarea,select):focus-visible {background:var(--ef-editor-field-bg-focus);}
body.profile-page .profile-customizer .profile-handle-field {border-radius:var(--ef-editor-radius);background:var(--ef-editor-field-bg);}
body.profile-page .profile-customizer .profile-handle-field input:not([type=checkbox]) {background:transparent;}
body.profile-page .profile-customizer .profile-upload-card {padding-block:10px;margin-bottom:10px;gap:8px 10px;}
body.profile-page .profile-customizer .profile-upload-preview {width:52px;height:52px;}
body.profile-page .profile-customizer .profile-editor-footer .primary {border-radius:12px;}
body.profile-page .profile-customizer .profile-editor-footer .primary > .ui-icon {display:none;}
body.profile-page .profile-customizer .profile-editor-footer > p[hidden] {display:none!important;}
body.profile-page .profile-customizer .profile-editor-tabs > button[aria-selected=true] {background:color-mix(in srgb,var(--ef-accent) 8%,transparent);}
/* Profile positioning only; skin/animation is owned by the common v544 switch contract below. */
body.profile-page .profile-customizer .profile-switch-control {width:54px;min-width:54px;height:30px;--ef-editor-switch-disabled-opacity:.45;}
body.profile-page .profile-customizer .profile-switch-track {inset:0;}
/* Range: native, keyboard accessible, fill computed from the actual min/max/value. */
body.profile-page .profile-customizer .profile-range input[type=range] {--ef-range-center:50%;appearance:none;-webkit-appearance:none;display:block;width:100%;height:28px;margin:0;background:transparent;cursor:pointer;accent-color:var(--ef-accent);}
body.profile-page .profile-customizer .profile-range input[type=range]::-webkit-slider-runnable-track {height:5px;border-radius:999px;border:0;background:linear-gradient(90deg,var(--ef-accent) 0 var(--ef-range-center,50%),var(--ef-editor-range-rail) var(--ef-range-center,50%) 100%);transition:height 160ms ease;}
body.profile-page .profile-customizer .profile-range input[type=range]::-moz-range-track {height:5px;border:0;border-radius:999px;background:linear-gradient(90deg,var(--ef-accent) 0 var(--ef-range-center,50%),var(--ef-editor-range-rail) var(--ef-range-center,50%) 100%);}
body.profile-page .profile-customizer .profile-range input[type=range]::-webkit-slider-thumb {-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-top:-5.5px;border:3px solid var(--ef-editor-range-thumb-ring);border-radius:50%;background:#fff;box-shadow:0 1px 6px #0005;transition:transform 180ms var(--ef-editor-snap);}
body.profile-page .profile-customizer .profile-range input[type=range]::-moz-range-thumb {width:12px;height:12px;border:3px solid var(--ef-editor-range-thumb-ring);border-radius:50%;background:#fff;box-shadow:0 1px 6px #0005;transition:transform 180ms var(--ef-editor-snap);}
body.profile-page .profile-customizer .profile-range input[type=range]:is(:hover,:focus-visible)::-webkit-slider-thumb {transform:scale(1.2);}
body.profile-page .profile-customizer .profile-range input[type=range]:is(:hover,:focus-visible)::-moz-range-thumb {transform:scale(1.2);}
/* The profile editor has a fixed layout on desktop, but keeps its existing mobile workflow. */
@media (max-width:639px) {
  body.profile-page .profile-customizer {width:100vw;max-width:100vw;grid-template-columns:minmax(0,1fr);}
  body.profile-page .profile-customizer .profile-editor-tabs {flex-direction:row;justify-content:flex-end;gap:4px;min-height:50px;padding:4px 12px;border:0;}
  body.profile-page .profile-customizer .profile-editor-tabs > button {width:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center;}
  body.profile-page .profile-customizer .profile-editor-body {padding:12px 14px;}
  body.profile-page .profile-customizer .profile-editor-footer {padding:9px 12px;}
}
@media (prefers-reduced-motion:reduce) {
  .ef-editor *,body.profile-page .profile-customizer .profile-switch-track,
  body.profile-page .profile-customizer .profile-switch-track::before,
  body.profile-page .profile-customizer .profile-editor-tabs > button > .ui-icon,
  body.profile-page .profile-customizer .profile-range input[type=range]::-webkit-slider-thumb {animation:none!important;transition:none!important;}
}

/* v537 / Reusable controls for collection, workshop, and quick-write editors.
   Existing literary writing canvases remain deliberately untouched. */
.ef-editor :is(input.ef-editor-input,textarea.ef-editor-textarea,select.ef-editor-select):not([type=hidden]):not([type=file]):not([type=color]) {
  display:block;max-width:100%;box-sizing:border-box;min-width:0;width:100%;
  border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-field-bg);
  color:var(--ef-text);box-shadow:none;padding:11px 13px;font:400 16px/1.5 var(--ef-font-ui);
  transition:background-color var(--ef-editor-quick) ease;
}
.ef-editor :is(.ef-editor-input,.ef-editor-select){min-height:44px;}
.ef-editor textarea.ef-editor-textarea{min-height:100px;resize:vertical;line-height:1.6;}
.ef-editor :is(input.ef-editor-input,textarea.ef-editor-textarea,select.ef-editor-select):focus-visible {
  outline:2px solid var(--ef-focus-ring);outline-offset:1px;background:var(--ef-editor-field-bg-focus);
}
.ef-editor :is(input.ef-editor-input,textarea.ef-editor-textarea)::placeholder{color:var(--ef-muted);opacity:1;}
.ef-editor :is(button.ef-editor-button,label.ef-editor-button) {
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:10px 14px;border:0;border-radius:var(--ef-editor-radius);
  background:var(--ef-editor-quiet-bg);box-shadow:none;color:var(--ef-text);
  text-decoration:none;font:550 15px/1.4 var(--ef-font-ui);cursor:pointer;
  transition:background-color var(--ef-editor-quick) ease,color var(--ef-editor-quick) ease,transform var(--ef-editor-quick) var(--ef-editor-snap);
}
.ef-editor :is(button.ef-editor-button,label.ef-editor-button):hover{background:var(--ef-hover);color:var(--ef-text);}
.ef-editor button.ef-editor-button--primary {background:var(--ef-accent);color:var(--ef-accent-ink);}
.ef-editor button.ef-editor-button--primary:hover{background:var(--ef-accent-strong);color:var(--ef-accent-ink);}
.ef-editor :is(button.ef-editor-button,label.ef-editor-button):focus-visible{outline:2px solid var(--ef-focus-ring);outline-offset:2px;}
.ef-editor :is(button.ef-editor-button,label.ef-editor-button):active:not(:disabled){transform:scale(.985);}
.ef-editor button.ef-editor-button:disabled{opacity:.45;cursor:not-allowed;}
/* Original native input remains focusable. Thin outline off, filled square on. */
.ef-editor input[type=checkbox].ef-editor-checkbox {
  position:relative;display:inline-grid;place-items:center;flex:0 0 22px;
  box-sizing:border-box;appearance:none;-webkit-appearance:none;width:22px;height:22px;
  min-width:22px;max-width:22px;min-height:22px;max-height:22px;
  margin:0;padding:0;border:1px solid color-mix(in srgb,var(--ef-accent) 48%,var(--ef-muted));
  border-radius:6px;background:transparent;cursor:pointer;opacity:1;
  transition:background-color var(--ef-editor-smooth) ease,border-color var(--ef-editor-smooth) ease,transform var(--ef-editor-quick) ease;
}
.ef-editor input[type=checkbox].ef-editor-checkbox::after{
  content:"";display:block;width:11px;height:6px;
  border-left:2px solid var(--ef-accent-ink);border-bottom:2px solid var(--ef-accent-ink);
  transform:translateY(-1px) rotate(-45deg) scale(.65);transform-origin:center;
  opacity:0;transition:transform var(--ef-editor-smooth) var(--ef-editor-snap),opacity var(--ef-editor-quick) ease;
}
.ef-editor input[type=checkbox].ef-editor-checkbox:checked{background:var(--ef-accent);border-color:var(--ef-accent);}
.ef-editor input[type=checkbox].ef-editor-checkbox:checked::after{opacity:1;transform:translateY(-1px) rotate(-45deg) scale(1);}
.ef-editor input[type=checkbox].ef-editor-checkbox:focus-visible{outline:2px solid var(--ef-focus-ring);outline-offset:3px;}
.ef-editor input[type=checkbox].ef-editor-checkbox:active{transform:scale(.92);}
.ef-editor input[type=checkbox].ef-editor-checkbox:disabled{opacity:.4;cursor:default;}
/* Native switch geometry; all switch variants share the paint contract below. */
.ef-editor .ef-editor-switch-field{display:flex;justify-content:space-between;align-items:center;min-height:52px;gap:14px;cursor:pointer;}
.ef-editor input[type=checkbox].ef-editor-switch{
  appearance:none;-webkit-appearance:none;position:relative;display:block;
  box-sizing:border-box;flex:0 0 54px;width:54px;min-width:54px;height:30px;
  margin:0;padding:0;cursor:pointer;
}
.ef-editor input[type=checkbox].ef-editor-switch:active::before{transform:translateX(1px) scale(.92);}
.ef-editor input[type=checkbox].ef-editor-switch:checked:active::before{transform:translateX(23px) scale(.92);}
.ef-editor input[type=checkbox].ef-editor-switch:disabled{cursor:not-allowed;}
/* The compact settings drawer is a true edge-mounted dialog. It inherits the
   single editor control system without rewriting quick-write's actual content. */
.ef-editor .qw-dialog.ef-editor-surface,
.qw-shell.ef-editor > .qw-dialog.ef-editor-surface {
  position:fixed;inset:0 0 0 auto;margin:0;
  box-sizing:border-box;width:min(var(--ef-editor-drawer-width),100vw);max-width:100vw;
  height:100dvh;max-height:100dvh;overflow:hidden;border:0;border-radius:0;
  padding:0;background:var(--ef-surface-deep);color:var(--ef-text);box-shadow:none;
}
.qw-shell.ef-editor > .qw-dialog.ef-editor-surface[open]{display:flex;flex-direction:column;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-body {
  flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;
  padding:0 var(--ef-editor-padding) 22px;scrollbar-width:thin;scrollbar-color:var(--ef-border-strong) transparent;
}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-heading{position:sticky;top:0;z-index:2;background:var(--ef-surface-deep);padding:19px 0 15px;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-heading h2{font:600 22px/1.3 var(--ef-font-ui);letter-spacing:-.025em;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-group{border:0;padding:14px 0 18px;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-group h3{font:600 16px/1.4 var(--ef-font-ui);margin:0 0 12px;color:var(--ef-accent-strong);}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-field{border:0;min-height:48px;font-size:15px;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-field.ef-editor-switch-field{border:0;padding:9px 0;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface :is(textarea.ef-editor-textarea,select.ef-editor-select){font-size:16px;}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-dialog-footer{flex:none;border:0;padding:12px var(--ef-editor-padding) calc(14px + env(safe-area-inset-bottom,0px));background:var(--ef-surface-deep);}
.qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-dialog-footer .ef-editor-button{width:100%;}
/* Collections use a full workspace, not a drawer: only standardize controls. */
.collections-editor-shell.ef-editor .ef-editor-field{display:grid;gap:8px;min-width:0;margin:0 0 16px;}
.collections-editor-shell.ef-editor :is(input.ef-editor-input,textarea.ef-editor-textarea){border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-field-bg);}
.collections-editor-shell.ef-editor .collection-editor-section h3{color:var(--ef-text);font:600 20px/1.3 var(--ef-font-ui);letter-spacing:-.02em;}
.collections-editor-shell.ef-editor .collection-editor-section{border-bottom-color:color-mix(in srgb,var(--ef-white) 6%,transparent);}
.collections-editor-shell.ef-editor .editor-actions button.ef-editor-button,
.collections-editor-shell.ef-editor .cover-editor-actions :is(button.ef-editor-button,label.ef-editor-button){border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-quiet-bg);color:var(--ef-text);}
.collections-editor-shell.ef-editor .editor-actions button.ef-editor-button--primary{background:var(--ef-accent);color:var(--ef-accent-ink);}
.collections-editor-shell.ef-editor .editor-actions button.ef-editor-button--primary:hover{background:var(--ef-accent-strong);}
.collections-editor-shell.ef-editor .ef-editor-actions-bar{border:0;box-shadow:none;}
/* Workshop's literary writing canvas (#title, #content) is NOT a standard field. */
.writing-studio .ef-editor :is(input.ef-editor-input,select.ef-editor-select,textarea.ef-editor-textarea){color:var(--ef-text);border: 0;background: var(--ef-editor-field-bg);border-radius: var(--ef-editor-radius);min-height: 44px;font-size: 16px;}
.writing-studio .ef-editor :is(input.ef-editor-input,select.ef-editor-select,textarea.ef-editor-textarea):focus-visible{outline:2px solid var(--ef-focus-ring);outline-offset:1px;}
.writing-studio .ef-editor .studio-check.ef-editor-check-row{width:fit-content;border:0;padding:9px 11px;border-radius:var(--ef-editor-radius);background:var(--ef-editor-quiet-bg);}
.writing-studio .ef-editor .editor-actions button.ef-editor-button{border:0;border-radius:var(--ef-editor-radius);}
.writing-studio .ef-editor .editor-actions button.ef-editor-button--primary{background:var(--ef-accent);color:var(--ef-accent-ink);}
.writing-studio .ef-editor .editor-actions button.ef-editor-button--primary:hover{background:var(--ef-accent-strong);}
@media(max-width:639px){
  .qw-shell.ef-editor .qw-dialog.ef-editor-surface{width:100vw;max-width:100vw;}
  .qw-shell.ef-editor .qw-dialog.ef-editor-surface .qw-settings-body{padding-inline:14px;}
}
@media(prefers-reduced-motion:reduce){
  .ef-editor .ef-editor-button,.ef-editor .ef-editor-checkbox,.ef-editor .ef-editor-checkbox::after,
  .ef-editor .ef-editor-switch,.ef-editor .ef-editor-switch::before,
  .ef-editor :is(.ef-editor-input,.ef-editor-textarea,.ef-editor-select){transition:none!important;animation:none!important;}
}


/* v538 — administrative opt-in adapters.
   The inherited editor system owns visual controls. Layout, runtime and HTML IDs
   stay in their original modules; the reader/site artwork stays untouched. */
.ef-admin-editor-v538 {--ef-editor-admin-rule:color-mix(in srgb,var(--ef-accent) 9%,transparent);}
.ef-admin-editor-v538 :is(.console-rule-settings,.console-simulator,.console-event-detail,.moderation-grid,#reports-filter)
  :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea,.custom-control-trigger),
.ef-admin-editor-v538 #site-settings-form :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea,.custom-control-trigger),
.ef-admin-editor-v538 #mail-settings-form :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea,.custom-control-trigger),
.ef-admin-editor-v538 :is(#profile-role-form,#profile-ban-form,#profile-admin-search)
  :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea,.custom-control-trigger) {
  box-sizing:border-box;width:100%;min-width:0;min-height:44px;
  padding:10px 13px;border:0;border-radius:var(--ef-editor-radius);
  background:var(--ef-editor-field-bg);box-shadow:none;color:var(--ef-text);
  font:400 16px/1.5 var(--ef-font-ui);outline:none;
  transition:background-color var(--ef-editor-quick) ease;
}
/* v547: native radio/range/button inputs remain independent of text fields.
   v546: focus paint only for text-entry fields. :where() retains the old
   text-field selector specificity; a broad input rule used to repaint focused
   checked moderation checkboxes because :is() contains an ID selector. */
.ef-admin-editor-v538 :is(.console-rule-settings,.console-simulator,.console-event-detail,.moderation-grid,#reports-filter)
  :is(input:where(:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=hidden])),select,textarea,.custom-control-trigger):focus-visible,
.ef-admin-editor-v538 :is(#site-settings-form,#mail-settings-form,#profile-role-form,#profile-ban-form,#profile-admin-search)
  :is(input:not([type=checkbox]):where(:not([type=radio],[type=range],[type=color],[type=file],[type=hidden])),select,textarea,.custom-control-trigger):focus-visible {
  outline:2px solid var(--ef-focus-ring);outline-offset:1px;
  background:var(--ef-editor-field-bg-focus);
}
/* v543 — old v538 checkbox paint/animation rules removed. All three admin
   forms inherit the one .ef-editor-checkbox primitive above. Only contextual
   layout/focus behaviors are retained; there is no duplicate checkbox skin. */
.ef-admin-editor-v538 #site-settings-form .settings-toggle input[type=checkbox].ef-editor-checkbox {flex:0 0 22px;}
.ef-admin-editor-v538 :is(#site-settings-form,.console-scope,.moderation-verify) input[type=checkbox].ef-editor-checkbox:disabled {cursor:not-allowed;}
.ef-admin-editor-v538 :is(#site-settings-form,.console-scope,.moderation-verify) input[type=checkbox].ef-editor-checkbox:focus-visible {outline-offset:1px;}
.ef-admin-editor-v538 :is(#site-settings-form,.console-scope,.moderation-verify) input[type=checkbox].ef-editor-checkbox:active {transform:scale(.93);}
/* Keep moderation's input+span pairing and accessible 44px label hit area. */
.admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy {
  position:relative;display:block;flex:0 0 54px;box-sizing:border-box;
  width:54px;min-width:54px;height:44px;margin:-7px -6px 0 0;cursor:pointer;
}
.admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy input {
  position:absolute;inset:7px 0;z-index:2;width:54px;height:30px;margin:0;opacity:0;cursor:pointer;
}
.admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy>span {
  position:absolute;left:0;top:7px;display:block;
}
/* v544: one switch paint and animation contract for profile, moderation and
   native editors. Contexts retain their original HTML and interaction logic. */
:is(
  body.profile-page .profile-customizer .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy>span,
  .ef-editor input[type=checkbox].ef-editor-switch
) {
  box-sizing:border-box;width:54px;min-width:54px;height:30px;
  border:0;border-radius:999px;background-color:var(--ef-editor-switch-off);
  transition:background-color var(--ef-editor-smooth) var(--ef-editor-snap);
}
:is(
  body.profile-page .profile-customizer .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy>span,
  .ef-editor input[type=checkbox].ef-editor-switch
)::before {
  content:"";position:absolute;left:4px;top:4px;box-sizing:border-box;
  width:22px;height:22px;border:0;border-radius:50%;background:var(--ef-editor-knob-off);
  transform:translateX(0);transition:transform 300ms var(--ef-editor-snap),background-color 200ms ease;
}
:is(
  body.profile-page .profile-customizer .profile-switch-control input:checked + .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy input:checked+span,
  .ef-editor input[type=checkbox].ef-editor-switch:checked
) {background-color:var(--ef-accent);}
:is(
  body.profile-page .profile-customizer .profile-switch-control input:checked + .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy input:checked+span,
  .ef-editor input[type=checkbox].ef-editor-switch:checked
)::before {transform:translateX(24px);background:var(--ef-white);}
:is(
  body.profile-page .profile-customizer .profile-switch-control input:focus-visible + .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy input:focus-visible+span,
  .ef-editor input[type=checkbox].ef-editor-switch:focus-visible
) {outline:2px solid var(--ef-focus-ring);outline-offset:3px;}
:is(
  body.profile-page .profile-customizer .profile-switch-control input:disabled + .profile-switch-track,
  .admin-console .ef-admin-editor-v538 label.console-switch.ef-editor-switch-legacy input:disabled+span,
  .ef-editor input[type=checkbox].ef-editor-switch:disabled
) {opacity:var(--ef-editor-switch-disabled-opacity,.4);}
/* Calm administration action buttons, including generated forms. */
.admin-console .ef-admin-editor-v538 :is(.console-secondary,.console-primary,.button) {
  min-height:44px;padding:10px 14px;border:0;border-radius:var(--ef-editor-radius);
  background:var(--ef-editor-quiet-bg);color:var(--ef-text);box-shadow:none;
  font:550 15px/1.45 var(--ef-font-ui);transition:background-color var(--ef-editor-quick) ease,transform var(--ef-editor-quick) var(--ef-editor-snap);
}
.admin-console .ef-admin-editor-v538 :is(.console-secondary,.button):hover:not(:disabled) {background:var(--ef-hover);}
.admin-console .ef-admin-editor-v538 :is(.console-primary,.button.primary,#settings-save),
.admin-console .ef-admin-editor-v538 #mail-settings-form button.primary {
  background:var(--ef-accent);color:var(--ef-accent-ink)!important;
}
.admin-console .ef-admin-editor-v538 :is(.console-primary,.button.primary,#settings-save):hover:not(:disabled),
.admin-console .ef-admin-editor-v538 #mail-settings-form button.primary:hover:not(:disabled) {background:var(--ef-accent-strong);}
/* Site settings: less visual noise, no extra card border around labels. */
.admin-console .ef-admin-editor-v538 #site-settings-form label {margin-bottom:16px;}
.admin-console .ef-admin-editor-v538 #site-settings-form .settings-section-head {border-color:var(--ef-editor-admin-rule);padding-bottom:17px;margin-bottom:20px;}
.admin-console .ef-admin-editor-v538 #site-settings-form .settings-divider {border-color:var(--ef-editor-admin-rule);padding-top:18px;margin-top:25px;}
.admin-console .ef-admin-editor-v538 #site-settings-form .settings-save-bar {border:0;border-top:1px solid var(--ef-editor-admin-rule);background:var(--ef-surface-deep);padding:12px 0;}
.admin-console .ef-admin-editor-v538 #site-settings-form .settings-toggle {display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 0;cursor:pointer;}
/* Adaptive workspaces: don't force any full-page administration into a narrow drawer. */
@media (max-width:639px) {
 .ef-admin-editor-v538 :is(.console-rules-layout,.moderation-grid) {grid-template-columns:minmax(0,1fr);}
 .ef-admin-editor-v538 :is(.settings-form,#reports-filter,.console-rule-settings) {min-width:0;}
}
@media (prefers-reduced-motion:reduce) {
 .ef-admin-editor-v538 :is(.console-switch,.console-switch>span,.console-switch>span::before,.ef-editor-checkbox),
 .ef-admin-editor-v538 :is(input,textarea,select,.button,.console-primary,.console-secondary) {transition:none!important;animation:none!important;}
}


/* v539 — account: opt-in only (login, registration, security), no legal page selectors.
   All controls follow the same field/button/checkbox tokens as the profile editor.
   Authentication, VK, codes, dialogs and 2FA remain native, unaffected behaviors. */
.ef-account-editor-v539 {
  --ef-check-size:22px;
  --ef-check-radius:6px;
  --ef-editor-account-section-gap:18px;
  color:var(--ef-text);
}
/* Preserve account layout/semantics. Update visual controls, never hide inputs. */
.account-page .ef-account-editor-v539 :is(form input:not([type=hidden]):not([type=checkbox]):not([type=file]),form select,form textarea) {
  box-sizing:border-box;width:100%;min-width:0;min-height:44px;
  border:0;border-radius:var(--ef-editor-radius);padding:11px 14px;
  background:var(--ef-editor-field-bg);color:var(--ef-text);
  font:400 16px/1.5 var(--ef-font-ui);box-shadow:none;
  transition:background-color var(--ef-editor-quick) ease;
}
.account-page .ef-account-editor-v539 :is(form input:not([type=hidden]):not([type=checkbox]):not([type=file]),form select,form textarea):hover {
  border:0;background:var(--ef-editor-field-bg-focus);box-shadow:none;
}
.account-page .ef-account-editor-v539 :is(form input:not([type=hidden]):not([type=checkbox]):not([type=file]),form select,form textarea):focus-visible {
  outline:2px solid var(--ef-focus-ring);outline-offset:1px;
  border:0;background:var(--ef-editor-field-bg-focus);box-shadow:none;
}
/* Dedicated action styles: primary remains obvious, secondary never becomes a card. */
.account-page .ef-account-editor-v539 button:not(.account-primary):not(.account-danger):not(#account-logout):not(.account-provider) {
  border:0;border-radius:var(--ef-editor-radius);
  background:var(--ef-editor-quiet-bg);color:var(--ef-text);
  box-shadow:none;transition:background-color var(--ef-editor-quick) ease,color var(--ef-editor-quick) ease;
}
.account-page .ef-account-editor-v539 button:not(.account-primary):not(.account-danger):not(#account-logout):not(.account-provider):hover {
  border:0;background:var(--ef-hover);color:var(--ef-text);
}
.account-page .ef-account-editor-v539 button.account-primary,
.account-page .ef-account-editor-v539 #account-setup {
  border:0;background:var(--ef-accent);color:var(--ef-accent-ink);
  border-radius:var(--ef-editor-radius);font-weight:600;box-shadow:none;
  transition:background-color var(--ef-editor-quick) ease;
}
.account-page .ef-account-editor-v539 :is(button.account-primary,#account-setup):hover {background:var(--ef-accent-strong);color:var(--ef-accent-ink);}
.account-page .ef-account-editor-v539 :is(button,input,textarea,summary,a):focus-visible {outline:2px solid var(--ef-focus-ring);outline-offset:2px;}
/* VK is a provider choice, not the primary submit control. Its real logo stays. */
.account-entry .ef-account-editor-v539 .account-provider {
  background:var(--ef-editor-quiet-bg);border:0;border-radius:var(--ef-editor-radius);
  min-height:52px;transition:background-color var(--ef-editor-quick) ease;
}
.account-entry .ef-account-editor-v539 .account-provider:hover {background:var(--ef-hover);border:0;}
/* The original consent labels use a two-column grid to keep multiline text aligned. */
.account-entry .ef-account-editor-v539 .account-consents .ef-editor-check-row {
  display:grid;grid-template-columns:22px minmax(0,1fr);gap:12px;align-items:start;
  min-height:44px;margin:0;padding:10px 8px;border:0;border-radius:var(--ef-editor-radius);
  background:transparent;line-height:1.5;
}
.account-entry .ef-account-editor-v539 .account-consents .ef-editor-check-row:hover {background:var(--ef-editor-quiet-bg);}
.account-manage .ef-editor-check-row.account-check {
  display:flex;align-items:center;gap:12px;min-height:44px;margin:0;padding:9px 11px;
  background:var(--ef-editor-quiet-bg);border:0;border-radius:var(--ef-editor-radius);
}
/* v543 — registration/newsletter checkbox artwork is inherited from the same
   .ef-editor-checkbox used by profiles and admin; account controls provide layout only. */
/* Account-security sections stay flat, with softer separators and controls. */
.account-page .ef-account-editor-v539.account-manage .account-panel {border-bottom-color:color-mix(in srgb,var(--ef-white) 6%,transparent);}
.account-page .ef-account-editor-v539.account-manage .account-inline {border-top-color:color-mix(in srgb,var(--ef-white) 6%,transparent);}
.account-page .ef-account-editor-v539.account-manage .account-operation-dialog {border:0;border-radius:var(--ef-editor-radius);}
.account-page .ef-account-editor-v539.account-manage :is(.account-secret output,.account-recovery pre) {
  border:0;border-radius:var(--ef-editor-radius);background:var(--ef-editor-field-bg);
}
@media (prefers-reduced-motion:reduce) {
 .account-page .ef-account-editor-v539 :is(button,input,textarea,select),
 .account-page .ef-account-editor-v539 .ef-editor-checkbox {transition:none!important;animation:none!important;}
}

/* v547: approved v11 editor affordances; legacy controls stay in DOM for old listeners. */
body.profile-page .profile-customizer .profile-editor-section-title--inline {display:flex;align-items:center;justify-content:space-between;gap:12px;}
body.profile-page .profile-customizer .profile-editor-section-title--inline .profile-add-link--icon {
  display:inline-grid;place-items:center;flex:none;width:34px;height:34px;min-height:34px;padding:0;
  margin:0;border:0;border-radius:9px;background:var(--ef-editor-quiet-bg);color:var(--ef-text);
  font:500 22px/1 var(--ef-font-ui);transition:background-color var(--ef-editor-quick) ease,transform var(--ef-editor-quick) ease;
}
body.profile-page .profile-customizer .profile-editor-section-title--inline .profile-add-link--icon:hover {background:var(--ef-hover);}
body.profile-page .profile-customizer .profile-editor-section-title--inline .profile-add-link--icon:focus-visible {outline:2px solid var(--ef-focus-ring);outline-offset:2px;}
body.profile-page .profile-customizer :is(#profile-reset-design,#profile-reset-background,[data-gallery])[hidden] {display:none!important;}
