#lbrank-style-bar[hidden],#lbrank-style-editor[hidden]{display:none!important}
#lbrankOpenElementStyles{width:100%;min-height:45px;border-radius:13px;border:1px solid #53d7e666;background:#53d7e616;color:#8cefff;font:800 13px system-ui;cursor:pointer}
#lbrank-style-bar,#lbrank-style-editor{z-index:2147483646!important;position:fixed;background:#111a2ef5!important;border:1px solid #546785!important;color:#eef4ff!important;box-shadow:0 15px 50px #000a!important;backdrop-filter:blur(20px)!important;font:12px/1.4 system-ui!important;box-sizing:border-box!important}
#lbrank-style-bar{bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(97vw,550px);display:flex;align-items:center;gap:8px;border-radius:16px;padding:9px}
#lbrank-style-bar span{flex:1;color:#bbcae1;font-size:11px}
#lbrank-style-bar button,#lbrank-style-editor button{padding:10px;border:1px solid #60799b!important;border-radius:11px;background:#253453!important;color:#fff!important;font:800 12px system-ui!important;cursor:pointer}
#lbrank-style-editor{right:10px;bottom:85px;width:min(370px,calc(100vw - 20px));max-height:75dvh;overflow:auto;padding:15px;border-radius:18px}
#lbrank-style-editor header,#lbrank-style-editor footer{display:flex;justify-content:space-between;align-items:center;gap:10px}
#lbrank-style-editor header strong{font-size:17px}
#lbrank-style-editor small{display:block;margin:9px 0 15px;color:#b1c1dc;overflow-wrap:anywhere}
#lbrank-style-editor .lbrank-colors{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
#lbrank-style-editor label{display:flex;flex-direction:column;gap:5px;color:#d8e3f7}
#lbrank-style-editor input[type=color]{width:100%;height:40px;padding:3px;background:#1f2c47;border:1px solid #536789;border-radius:10px}
#lbrank-style-editor input[type=checkbox]{accent-color:#53d7e6}
#lbrank-style-editor #lbrank-regular{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#lbrank-style-editor #lbrank-regular label,#lbrank-style-editor #lbrank-button-styles>label:has(input){flex-direction:row;align-items:center}
#lbrank-style-editor section{margin-top:15px}
#lbrank-style-editor select{width:100%;background:#1b2c4b!important;color:#fff!important;border:1px solid #546c92!important;border-radius:10px;padding:10px}
#lbrank-style-editor footer{margin-top:15px}
#lbrank-style-editor footer button{flex:1}
#lbrank-style-editor #lbrank-save-element{background:#196c7e!important;border-color:#53d7e6!important}
.lbrank-style-selected{outline:2px solid #bba6ff!important;outline-offset:3px!important}
body.lbrank-style-picking{cursor:crosshair!important}

#lbrank-style-editor [hidden]{display:none!important}
.original-element-style-entry{padding:15px;margin:15px 0;border:1px solid rgba(127,165,219,.24);border-radius:15px;background:rgba(84,130,190,.07)}
.original-element-style-entry strong{display:block;font:800 14px system-ui;margin-bottom:6px}
.original-element-style-entry p{font:12px/1.5 system-ui;color:var(--ui-card-description,#b5c1d6);margin-bottom:12px}

/* Remove-property controls are independent of a button's style preset. */
#lbrank-style-editor .lbrank-removals{
 border:1px solid rgba(141,177,230,.24)!important;
 border-radius:12px!important;
 padding:10px!important;margin:12px 0!important;
 display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;
 background:rgba(87,126,198,.06)!important;min-width:0!important;
}
#lbrank-style-editor .lbrank-removals legend{
 color:#a9c7f2!important;font-size:11px!important;font-weight:800!important;
 padding:0 5px!important;
}
#lbrank-style-editor .lbrank-removals label{
 display:flex!important;flex-direction:row!important;align-items:center!important;
 gap:7px!important;color:#deebfb!important;font-size:11px!important;
}
#lbrank-style-editor .lbrank-removals input[type="checkbox"]{
 width:17px!important;height:17px!important;flex:0 0 17px!important;
}
#lbrank-style-editor .lbrank-removals[hidden],
#lbrank-style-editor [hidden]{display:none!important}
#lbrank-style-bar{
 width:min(calc(100vw - 14px),680px)!important;
 flex-wrap:wrap!important;justify-content:space-between!important;
}
#lbrank-style-bar #lbrank-style-status{
 flex:1 1 110px!important;min-width:70px!important;
}
#lbrank-style-bar :is(#lbrank-export-json,#lbrank-export-css){
 background:rgba(74,152,205,.18)!important;border-color:rgba(111,195,229,.45)!important;
}
@media(max-width:480px){
 #lbrank-style-bar{padding:7px!important;gap:6px!important}
 #lbrank-style-bar button{padding:8px!important;font-size:10px!important}
 #lbrank-style-bar #lbrank-style-status{flex-basis:100%!important;order:2!important;text-align:center!important}
 #lbrank-style-editor{max-height:66dvh!important}
}


/* Element stack inspector: tap once, then choose a front, underlying or parent layer. */
#lbrank-layer-picker[hidden]{display:none!important}
#lbrank-layer-picker{
 position:fixed!important;top:max(10px,env(safe-area-inset-top))!important;
 left:50%!important;transform:translateX(-50%)!important;
 width:min(94vw,430px)!important;max-height:min(67dvh,650px)!important;
 overflow:hidden!important;display:flex!important;flex-direction:column!important;
 z-index:2147483647!important;
 box-sizing:border-box!important;border-radius:19px!important;
 color:#ecf4ff!important;background:rgba(15,24,45,.98)!important;
 border:1px solid rgba(141,194,239,.48)!important;
 box-shadow:0 18px 55px rgba(0,0,0,.74)!important;
 backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important;
 padding:12px!important;font:12px/1.35 system-ui,sans-serif!important;
}
#lbrank-layer-picker .lbrank-layer-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
#lbrank-layer-picker .lbrank-layer-head strong{font-size:15px;color:#f3f6ff}
#lbrank-layer-picker button{
 flex:0 0 auto;background:rgba(88,128,190,.12)!important;
 color:#e6efff!important;-webkit-text-fill-color:#e6efff!important;
 border:1px solid rgba(136,168,213,.3)!important;border-radius:10px!important;
 padding:9px!important;font:650 12px system-ui!important;text-align:left;cursor:pointer;
}
#lbrank-layer-picker .lbrank-layer-head button{padding:7px 12px!important;font-size:17px!important}
#lbrank-layer-picker p{font-size:11px;line-height:1.45;color:#aebdda;margin:7px 0 10px}
#lbrank-layer-picker .lbrank-layer-list{
 overflow-y:auto;min-height:0;display:grid;align-content:start;gap:6px;overscroll-behavior:contain;
}
#lbrank-layer-picker .lbrank-layer-choice{
 display:flex;align-items:center;gap:9px;min-height:41px;min-width:0;
}
#lbrank-layer-picker .lbrank-layer-choice:active,
#lbrank-layer-picker .lbrank-layer-choice:focus-visible{
 background:rgba(83,215,230,.2)!important;border-color:#53d7e6!important;
}
#lbrank-layer-picker .lbrank-layer-parent{border-style:dashed!important}
#lbrank-layer-picker .lbrank-layer-index{
 display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;
 border-radius:8px;background:rgba(83,215,230,.14);
 color:#8cedff;font-size:11px;font-weight:850;
}
#lbrank-layer-picker .lbrank-layer-description{
 min-width:0;overflow-wrap:anywhere;white-space:normal;line-height:1.3;
}

/* SVG and icon-font colors independent of surrounding button styles. */
#lbrank-style-editor #lbrank-icon-options{
 margin:12px 0!important;
 padding:11px!important;
 background:rgba(53,108,158,.09)!important;
 border:1px solid rgba(110,175,211,.27)!important;
 border-radius:12px!important;
}
#lbrank-style-editor #lbrank-icon-options strong{
 display:block!important;color:#a8e6fa!important;
 font:800 12px system-ui,sans-serif!important;margin-bottom:9px!important;
}
#lbrank-style-editor #lbrank-icon-options>label,
#lbrank-style-editor #lbrank-selected-settings>label:has(input[type="checkbox"]){
 display:flex!important;flex-direction:row!important;
 align-items:center!important;gap:9px!important;
}
#lbrank-style-editor #lbrank-icon-options .lbrank-colors{
 grid-template-columns:minmax(0,1fr)!important;max-width:150px!important;
}

/* Reusable editor color palette: swatches apply to focused color input. */
#lbrank-style-editor .lbrank-palette{
 padding:11px 0 10px!important;
 border-bottom:1px solid rgba(151,182,227,.18)!important;
 margin:10px 0!important;
}
#lbrank-style-editor .lbrank-palette-controls{
 display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;
}
#lbrank-style-editor .lbrank-palette-controls strong{
 flex:1 1 100px!important;font-size:12px!important;color:#d9eaff!important;
}
#lbrank-style-editor .lbrank-palette-controls button{
 min-height:33px!important;padding:6px 9px!important;font-size:10px!important;
}
#lbrank-style-editor .lbrank-palette>small{
 display:block!important;margin:7px 0!important;color:#95accb!important;font-size:10px!important;
}
#lbrank-style-editor .lbrank-swatches{
 display:flex!important;flex-wrap:wrap!important;gap:7px!important;
 max-height:100px!important;overflow-y:auto!important;
}
#lbrank-style-editor .lbrank-swatches .lbrank-color-chip{
 background:var(--chip-color)!important;
 width:32px!important;height:32px!important;min-width:32px!important;
 border:2px solid rgba(255,255,255,.42)!important;
 border-radius:10px!important;box-shadow:0 2px 7px #0006!important;
 padding:0!important;
}
#lbrank-style-editor input[type="color"][data-lbrank-color-target="true"]{
 outline:2px solid #53d7e6!important;outline-offset:2px!important;
}

/* Saved opacity controls (applies independently to each selected element). */
#lbrank-style-editor .lbrank-opacity-controls{
 margin:13px 0!important;padding:10px 2px 11px!important;
 border-top:1px solid rgba(154,184,226,.17)!important;
 border-bottom:1px solid rgba(154,184,226,.17)!important;
}
#lbrank-style-editor .lbrank-opacity-controls label{
 display:flex!important;flex-direction:row!important;
 justify-content:space-between!important;align-items:center!important;
 gap:10px!important;font:800 12px/1.25 system-ui!important;color:#e4efff!important;
}
#lbrank-style-editor .lbrank-opacity-controls output{
 font:800 12px system-ui!important;color:#8de9fc!important;
}
#lbrank-style-editor .lbrank-opacity-controls input[type="range"]{
 display:block!important;width:100%!important;margin:11px 0 3px!important;
 accent-color:#53d7e6!important;cursor:pointer!important;
}

/* Reusable Style Library: compact controls without additional floating panels */
#lbrank-style-editor .lbrank-style-library{display:grid;gap:8px;padding:10px 0;border-bottom:1px solid rgba(160,180,200,.18)}
#lbrank-style-editor .lbrank-style-library > label{display:grid;gap:5px}
#lbrank-style-editor .lbrank-style-library select{width:100%;min-height:34px}
#lbrank-style-editor .lbrank-library-buttons{display:flex;gap:5px;flex-wrap:wrap}
#lbrank-style-editor .lbrank-library-buttons button{flex:1 1 auto;min-height:32px;padding:5px 8px}
#lbrank-style-editor .lbrank-style-library small{opacity:.74;overflow-wrap:anywhere}

/* Border-radius adjustment: optional so existing element shapes remain untouched. */
#lbrank-style-editor .lbrank-radius-controls{display:grid;gap:7px;padding:9px 0}
#lbrank-style-editor .lbrank-radius-controls>label{display:flex;align-items:center;gap:7px;font-weight:600}
#lbrank-style-editor .lbrank-radius-row{display:grid;grid-template-columns:minmax(0,1fr) 62px auto;align-items:center;gap:7px}
#lbrank-style-editor .lbrank-radius-row input[type=range]{width:100%;min-width:0}
#lbrank-style-editor .lbrank-radius-row input[type=number]{width:100%;min-width:0;box-sizing:border-box;text-align:center}
#lbrank-style-editor .lbrank-radius-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#lbrank-style-editor .lbrank-radius-presets button{min-width:0;padding:6px 3px;font-size:12px}

/* Exchange normal/selected styles without adding a new container */
#lbrank-style-editor #lbrank-swap-states{display:block;width:100%;min-height:38px;margin:2px 0 10px;border:1px solid rgba(83,215,230,.45);border-radius:9px;background:rgba(83,215,230,.09);color:#53d7e6;font-weight:650;cursor:pointer}
