/* Smart Selection shell only; shared Editor sliders supply tracks and thumbs. */
.editor-page .smart-blending-control button.smart-blending-locked { color: #999; opacity: .65; cursor: help; }
.editor-page .smart-blending-control button[aria-pressed="true"]:not(.smart-blending-locked) { border-color: #78cdbb; }
.editor-page .smart-preview-section { display: grid; gap: 7px; min-width: 0; padding-top: 10px; border-top: 1px solid #ffffff30; }
.editor-page .smart-preview-section > strong { font-size: 12px; }
.editor-page .smart-preview-section [data-smart-preview-status] { color: #ddd; overflow-wrap: anywhere; }
.editor-page #editor-tool-settings-panel[data-smart-panel=true] {
  background: rgba(0,0,0,.8); color: #f2f2f2;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid #ffffff30; box-shadow: 0 12px 36px #0008;
}
@supports not (backdrop-filter: blur(1px)) {
  .editor-page #editor-tool-settings-panel[data-smart-panel=true] { background: #101010; }
}
.editor-page #editor-tool-settings-panel[data-smart-panel=true] .editor-tool-settings-header { flex: 0 0 auto; min-height: 36px; gap: 6px; background: transparent; }
.editor-page #editor-tool-settings-panel[data-smart-panel=true] #editor-tool-settings-title { flex: 0 1 auto; margin-right: 0; }
.editor-page #editor-tool-settings-panel[data-smart-panel=true] #editor-tool-settings-close { margin-left: auto; }
.editor-page #editor-tool-settings-panel[data-smart-panel=true] #editor-tool-settings-fields { min-height: 0; padding: 10px 12px; overflow-x: hidden; }
.editor-page .smart-fields { display: grid; gap: 7px; min-width: 0; color: #eee; background: transparent; font-size: 12px; }
.editor-page .smart-fields .smart-field { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.editor-page #editor-tool-settings-panel .smart-fields select { min-width: 0; width: auto; max-width: 66%; }
.editor-page #editor-tool-settings-panel .smart-fields :is(button,select),
.editor-page #tool-properties.smart-tool-strip button {
  min-height: 34px; padding: 5px 8px; border: 1px solid #ffffff36; border-radius: 5px;
  background: #ffffff08; color: #eee; font: inherit; box-shadow: none;
}
.editor-page #editor-tool-settings-panel .smart-fields button:not(:disabled):hover,
.editor-page #tool-properties.smart-tool-strip button:not(:disabled):hover { border-color: #ffffff80; background: #ffffff13; box-shadow: 0 0 9px #ffffff15; }
.editor-page #editor-tool-settings-panel .smart-fields button:not(:disabled):active,
.editor-page #tool-properties.smart-tool-strip button:not(:disabled):active { background: #ffffff24; box-shadow: inset 0 1px 4px #0008; }
.editor-page #editor-tool-settings-panel .smart-fields button:disabled { opacity: .38; cursor: default; }
.editor-page .smart-fields :focus-visible,.editor-page .smart-tool-strip :focus-visible { outline: 2px solid #eee; outline-offset: 2px; }
.editor-page .smart-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-page .smart-fields .smart-actions button { flex: 1 1 120px; }
.editor-page .smart-fields :is(.smart-operations,.smart-history) button { flex: 1 1 0; }
.editor-page #editor-tool-settings-panel .smart-operations button[aria-pressed=true],
.editor-page #tool-properties.smart-tool-strip .smart-operations button[aria-pressed=true] { background: #ffffff24; color: #fff; border-color: #eee; box-shadow: inset 0 -2px #eee; font-weight: 650; }
.editor-page .smart-note { margin: 0; color: #aaa; font-size: 11px; line-height: 1.4; }
.editor-page .smart-correction { margin: 0; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; }
.editor-page .smart-fields .editor-slider { grid-template-columns: minmax(0,1fr) auto; gap: 0 8px; font-size: 12px; }
.editor-page .smart-fields .editor-slider-label { grid-column: 1; grid-row: 1; }
.editor-page .smart-fields .editor-slider-readout { grid-column: 2; grid-row: 1; }
.editor-page .smart-fields .editor-slider-track { grid-column: 1 / -1; grid-row: 2; margin: 0 6px; }
.editor-page .smart-fields [data-smart-slider=expand] .editor-slider-track::after { content: ''; position: absolute; left: 50%; top: 5px; height: 14px; width: 1px; background: #ffffff60; pointer-events: none; }
.editor-page .smart-fields [data-smart-slider=expand] .editor-slider-thumb { z-index: 1; }
.editor-page .smart-fields details > :not(summary) { margin-top: 7px; }
.editor-page .smart-fields summary { cursor: pointer; padding: 8px 0; min-height: 34px; box-sizing: border-box; border-top: 1px solid #ffffff20; }
.editor-page [data-smart-status] { margin: 0; color: #bbb; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.editor-page [data-smart-status][data-state=error] { color: #f1c69a; }
.editor-page .smart-compact-status { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.editor-page .smart-tool-strip .smart-field { gap: 6px; }
.editor-page #editor-tool-settings-panel[data-smart-panel=true] #smart-selection-help-button { flex: 0 0 28px; min-width: 28px; min-height: 28px; border-radius: 50%; color: #eee; border: 1px solid #ffffff36; font-size: 13px; }
.editor-page #smart-selection-help {
  position: fixed; inset: auto; margin: 0; padding: 12px 14px; box-sizing: border-box;
  z-index: 1100; overflow: auto; overscroll-behavior: contain;
  background: #101010f5; color: #ccc; border: 1px solid #ffffff40; border-radius: 7px;
  box-shadow: 0 10px 32px #0009; font-size: 12px; line-height: 1.45;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; cursor: default;
}
.editor-page #smart-selection-help p { margin: 0 0 9px; }
.editor-page #smart-selection-help p:last-child { margin-bottom: 0; }
.editor-page #smart-selection-help strong { display: block; margin-bottom: 2px; color: #fff; font-weight: 600; }
.editor-page:has(#smart-selection-help:not([hidden])) #editor-hover-help { display: none; }
@media (pointer: coarse), (max-width: 600px) {
  .editor-page #editor-tool-settings-panel .smart-fields :is(button,select,summary),
  .editor-page #tool-properties.smart-tool-strip :is(button,select) { min-height: 44px; }
  .editor-page #editor-tool-settings-panel[data-smart-panel=true] .editor-tool-settings-header { min-height: 44px; }
  .editor-page #editor-tool-settings-panel[data-smart-panel=true] .editor-tool-settings-header button { min-width: 44px; min-height: 44px; }
  .editor-page #editor-tool-settings-panel[data-smart-panel=true] #smart-selection-help-button { flex-basis: 44px; min-width: 44px; min-height: 44px; }
  .editor-page .smart-fields .editor-slider-track { height: 36px; }
  .editor-page .smart-fields .editor-slider-track::before,.editor-page .smart-fields .editor-slider-fill { top: 16px; }
  .editor-page .smart-fields .editor-slider-thumb { top: 12px; }
  .editor-page .smart-fields [data-smart-slider=expand] .editor-slider-track::after { top: 11px; }
  .editor-page #editor-tool-settings-panel .smart-fields .editor-slider-value { min-height: 32px; }
}

/* V2: native contextual shell, sliders and layer list. */
.editor-page .smart-control-group {display:grid;gap:7px;min-width:0;padding:4px 0 10px;border-bottom:1px solid #ffffff20;}
.editor-page .smart-control-group>strong {font-size:12px;color:#eee;}
.editor-page .smart-views button {flex:1 1 0;}
.editor-page .smart-views button[aria-pressed=true] {border-color:#eee;background:#ffffff24;}
.editor-page .layer-mask-controls {position:relative;flex:0 0 28px;align-self:center;}
.editor-page .layer-mask-controls>summary {list-style:none;cursor:pointer;display:flex;border:1px solid #b5b5b5;border-radius:3px;padding:1px;}
.editor-page .layer-mask-controls>summary::-webkit-details-marker {display:none;}
.editor-page .layer-mask-controls>summary[data-disabled=true] {opacity:.45;border-color:#e5ab83;}
.editor-page .layer-mask-controls canvas {width:24px;height:24px;}
.editor-page .layer-mask-menu {position:fixed;z-index:950;display:grid;min-width:135px;padding:5px;gap:4px;background:#171717;border:1px solid #ffffff40;border-radius:4px;box-shadow:0 6px 18px #0008;}
.editor-page .layer-mask-menu button {font:inherit;text-align:left;white-space:nowrap;min-height:28px;}

.editor-page .layers-panel .layer-row:has(.layer-mask-controls) {grid-template-columns:8px 18px minmax(0,1fr) 28px 30px;}
.editor-page .layer-row .layer-mask-controls {grid-column:4;grid-row:1;}
.editor-page .layer-row:has(.layer-mask-controls) .layer-lock {grid-column:5;grid-row:1;}

.editor-page .smart-fields .smart-views button {flex:1 1 0;min-width:0;}

/* Final polish: four compact groups within the original Smart shell. */
.editor-page #editor-smart-panel .smart-control-group {display:block;padding:0 0 5px;margin:0;border-bottom:1px solid #ffffff20;}
.editor-page #editor-smart-panel .smart-control-group>summary {min-height:30px;padding:7px 0;margin:0;border:0;font-size:11px;letter-spacing:.055em;color:#eee;font-weight:600;}
.editor-page #editor-smart-panel .smart-control-group[open]>:not(summary) {margin:5px 0 0;}
.editor-page #editor-smart-panel .smart-control-group .editor-slider {margin-top:6px;}
.editor-page #editor-smart-panel .smart-control-group .smart-actions {gap:4px;}
.editor-page #editor-smart-panel .smart-fields {gap:3px;}
.editor-page #editor-smart-panel .smart-note {font-size:10px;line-height:1.35;color:#aaa;}
.editor-page #editor-smart-panel .editor-slider-unit {font-size:10px;color:#aaa;}
.editor-page #editor-smart-panel .smart-control-group>details>summary {font-size:11px;padding:5px 0;}
