/* Freeform 12-column dashboard; preserve original approved WebP frames using nine slices. */
.react-dashboard-layout-workspace{container-type:inline-size}
.react-dashboard-custom-grid.react-dashboard-freeform-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:calc((100cqw - 66px)/12);grid-auto-flow:row;gap:6px;align-items:stretch}
.react-dashboard-freeform-grid>.react-dashboard-custom-cell{position:relative!important;isolation:isolate;min-width:0!important;min-height:0!important;height:100%;width:100%;overflow:visible!important;aspect-ratio:auto!important;grid-column:var(--panel-col)/span var(--panel-w)!important;grid-row:var(--panel-row)/span var(--panel-h)!important;--asteria-panel-frame:url("../assets/ui/dashboard/panel-frame-3x3.webp")}
.react-dashboard-freeform-grid>[data-frame-family="wide"]{--asteria-panel-frame:url("../assets/ui/dashboard/panel-frame-6x3.webp")}
.react-dashboard-freeform-grid>[data-frame-family="ultrawide"]{--asteria-panel-frame:url("../assets/ui/dashboard/panel-frame-9x3.webp")}
.react-dashboard-freeform-grid>[data-frame-family="tall"]{--asteria-panel-frame:url("../assets/ui/dashboard/panel-frame-3x6.webp")}
.react-dashboard-freeform-grid>.react-dashboard-custom-cell::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;box-sizing:border-box;border:clamp(9px,2cqw,21px) solid transparent;border-image-source:var(--asteria-panel-frame);border-image-slice:12%;border-image-repeat:stretch}
.react-dashboard-freeform-grid>.react-dashboard-custom-cell::after{content:"";position:absolute;inset:clamp(7px,1.5cqw,14px);z-index:0;pointer-events:none;background:#080d13 var(--asteria-panel-backdrop) center/cover no-repeat;clip-path:polygon(5% 0,95% 0,100% 5%,100% 95%,95% 100%,5% 100%,0 95%,0 5%)}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic{position:relative!important;z-index:2!important;width:100%;height:100%!important;min-height:0!important;border:0!important;border-radius:0!important;padding:clamp(13px,2cqw,25px)!important;box-shadow:none!important;background:transparent!important;overflow:visible!important;display:flex;flex-direction:column;}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic::before,body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic::after{content:none!important;display:none!important}
@container (max-width:900px){.react-dashboard-custom-grid.react-dashboard-freeform-grid{grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:auto;gap:10px}.react-dashboard-freeform-grid>.react-dashboard-custom-cell{grid-column:1/-1!important;grid-row:auto!important;height:auto;min-height:220px!important;aspect-ratio:auto!important}}
@container (max-width:620px){.react-dashboard-custom-grid.react-dashboard-freeform-grid{grid-template-columns:minmax(0,1fr)}.react-dashboard-freeform-grid>.react-dashboard-custom-cell{grid-column:1/-1!important;grid-row:auto!important;min-height:180px!important;height:auto!important}body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic{min-height:180px!important;height:auto!important;overflow:visible!important}}
/* Panel Update 1: artwork remains on the outer grid cell, behind the
   content and the approved PNG header. Only the body's contents scroll:
   its title plaque is not clipped or moved when long lists are scrolled.
   Nested panels outside the dashboard grid are unaffected. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic>.react-panel-scroll-region{
  position:relative;
  z-index:1;
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  max-width:100%;
  overflow-x:auto;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic>.react-panel-header{
  flex:0 0 auto;
  overflow:visible!important;
}
@container (max-width:620px){
  body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) .react-dashboard-freeform-grid>.react-dashboard-custom-cell>.asteria-react-panel.asteria-royal-relic>.react-panel-scroll-region{
    flex:auto;
    overflow:visible;
  }
}
.react-grid-editor-modal{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:12px;background:rgba(0,0,0,.85)}
.react-grid-editor-dialog{width:min(1150px,100%);max-height:92dvh;overflow:auto;background:#0d1722;color:#f0e6d5;border:1px solid #ae9461;padding:14px;border-radius:7px}
.react-grid-editor-header,.react-grid-editor-footer{display:flex;justify-content:space-between;align-items:center;gap:10px}
.react-grid-editor-header h2{font-size:1.15rem;margin:0}.react-grid-editor-footer{justify-content:flex-end;margin-top:12px}
.react-grid-editor-content{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:12px}
.react-grid-editor-scroller{overflow:auto;max-height:65vh;width:100%;border:1px solid #627d8c;background:#09131f}
.react-grid-editor-canvas{display:grid;grid-template-columns:repeat(12,48px);grid-template-rows:repeat(var(--grid-rows),48px);grid-auto-rows:48px;gap:6px;width:max-content;background-color:#0a1522;background-image:linear-gradient(rgba(130,168,195,.15) 1px,transparent 1px),linear-gradient(90deg,rgba(130,168,195,.15) 1px,transparent 1px);background-size:54px 54px}
.react-grid-editor-tile{position:relative;min-width:0;min-height:0}.react-grid-editor-tile-main{width:100%;height:100%;min-height:0!important;padding:3px!important;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;text-align:center;color:#f4e9d8!important;background:linear-gradient(145deg,#1e3649,#0c1822)!important;border:1px solid #bda066!important;touch-action:none;cursor:grab;overflow:hidden}
.react-grid-editor-tile-main b{font-size:.72rem;overflow-wrap:anywhere}.react-grid-editor-tile-main small{font-size:.63rem}.react-grid-editor-tile.selected>.react-grid-editor-tile-main{border:2px solid #56aeed!important}
.react-grid-editor-tile-resize{position:absolute;right:1px;bottom:1px;z-index:3;min-height:25px!important;width:26px;padding:0!important;touch-action:none;cursor:nwse-resize}
.react-grid-editor-properties{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid #465d6e;background:#101e2b}.react-grid-editor-properties label{display:grid;gap:3px;font-size:.78rem}.react-grid-editor-properties input,.react-grid-editor-properties select{width:100%;min-width:0;min-height:35px}.react-grid-editor-properties h3{margin:0}
.react-dashboard-layout-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
@media (max-width:720px){.react-grid-editor-content{grid-template-columns:1fr}.react-grid-editor-scroller{max-height:43vh}.react-grid-editor-properties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.react-grid-editor-properties h3{grid-column:1/-1}}

/* Phase 7 mobile usability: improve touch access only in the layout editor.
   Approved panel frames, labels and dashboard geometry are untouched. */
.react-grid-editor-tile-resize{
  min-height:44px!important;
  min-width:44px!important;
  width:44px!important;
  right:0;
  bottom:0;
  display:grid;
  place-items:center;
  font-size:1.15rem;
}
.react-grid-editor-tile-main:focus-visible,
.react-grid-editor-tile-resize:focus-visible,
.react-grid-editor-dialog button:focus-visible,
.react-grid-editor-dialog input:focus-visible{
  outline:3px solid #c7e9ff!important;
  outline-offset:2px;
}
.react-grid-editor-scroller{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.react-grid-editor-dialog{
  overscroll-behavior:contain;
}
.react-grid-editor-properties input,
.react-grid-editor-properties select,
.react-grid-editor-properties button,
.react-grid-editor-footer button,
.react-grid-editor-header button{
  min-height:44px;
}
@media (max-width:720px){
  .react-grid-editor-modal{
    padding:6px;
    align-items:center;
  }
  .react-grid-editor-dialog{
    max-height:calc(100dvh - 12px);
    padding:10px;
    width:100%;
  }
  .react-grid-editor-scroller{
    max-height:min(42dvh,420px);
    touch-action:pan-x pan-y;
  }
  .react-grid-editor-content{
    gap:10px;
  }
  .react-grid-editor-properties{
    grid-template-columns:repeat(2,minmax(0,1fr));
    min-width:0;
  }
  .react-grid-editor-header,.react-grid-editor-footer{
    flex-wrap:wrap;
  }
}

/* Phase 7 Update 2: visual grid editor lives in a body portal. Explicit
   viewport sizing protects tablet/desktop overlays from inherited widths. */
.react-grid-editor-modal{
  width:100vw;
  max-width:100vw;
  min-height:100dvh;
  box-sizing:border-box;
}

/* Dashboard editor: floating tiles, animated layout and integrated library. */
.react-grid-editor-content:has(>.react-grid-editor-scroller){display:flex;min-width:0}
.react-grid-editor-content:has(>.react-grid-editor-scroller)>.react-grid-editor-scroller{flex:1;min-width:0}
.react-grid-editor-content:has(>.react-grid-editor-scroller)>.react-grid-editor-properties{display:flex;flex:1 1 100%;max-width:100%;padding:6px;gap:6px}
.react-grid-editor-tile{transition:grid-column .2s ease,grid-row .2s ease,transform .18s ease,box-shadow .18s ease;z-index:1}
.react-grid-editor-tile.dragging{z-index:30;transition:none;filter:drop-shadow(0 12px 15px rgba(0,0,0,.7))}
.react-grid-editor-tile.dragging .react-grid-editor-tile-main{cursor:grabbing}
.react-grid-editor-size-options{position:absolute;z-index:2;left:3px;bottom:3px;display:flex;flex-direction:column;align-items:stretch;gap:2px;min-width:48px;max-width:calc(100% - 6px)}
.react-grid-editor-size-options button{font-size:.67rem;line-height:1.2;min-height:24px;padding:2px 5px;background:rgba(5,13,24,.93);border:1px solid #718598;border-radius:3px;color:#e0e8ed;white-space:nowrap}
.react-grid-editor-size-options button[aria-pressed="true"]{border-color:#d2b579;color:#ffdfa7;background:#283746}
.react-grid-editor-tile-main{padding-bottom:6px!important;padding-left:55px!important}
.react-grid-editor-content:has(>.react-grid-editor-scroller){width:100%}
.react-grid-editor-library{min-width:0;border:1px solid #617687;background:#101f2c;padding:10px;max-height:65vh;overflow:auto}
.react-grid-editor-library h3{margin:0 0 10px}
.react-grid-editor-viewport{display:flex;gap:8px;margin:10px 0}
.react-grid-editor-viewport button[aria-pressed="true"],.react-dashboard-layout-filter button[aria-pressed="true"]{border-color:#d2b579;background:#263b4c;color:#fff}
.react-grid-editor-library-items{display:grid;gap:5px;margin-top:8px}
.react-grid-editor-library-item{display:flex;justify-content:space-between;align-items:center;gap:8px;text-align:left;min-height:42px;border:1px solid #556c7d;background:#142737;color:#eee0ce;padding:7px 10px}
.react-grid-editor-library-item b{flex:none;font-size:1.3rem;color:#a6d8ea}
.react-grid-editor-library-item[aria-pressed="true"] b{color:#9fd2aa}
.react-grid-editor-confirm{position:absolute;inset:10% auto auto 50%;transform:translateX(-50%);z-index:50;width:min(480px,90vw);padding:20px;border:2px solid #c5a76c;background:#101e2b;box-shadow:0 0 0 100vmax rgba(0,0,0,.75)}
.react-grid-editor-confirm button{margin-right:8px;min-height:44px}
@media(max-width:720px){.react-grid-editor-content{grid-template-columns:minmax(0,1fr)}
 .react-grid-editor-library{max-height:30vh}
 .react-grid-editor-viewport{flex-wrap:wrap}
 .react-grid-editor-tile{transition:transform .18s ease}
 .react-grid-editor-size-options button{min-height:27px}
}
@media(prefers-reduced-motion:reduce){.react-grid-editor-tile,.react-grid-editor-tile.dragging{transition:none!important;animation:none!important}}

.react-grid-editor-lock{position:absolute;z-index:4;top:2px;right:2px;min-height:28px;padding:1px 5px;font-size:.66rem;background:#13283a;color:#e4ddc9;border:1px solid #68859a}
.react-grid-editor-lock[aria-pressed="true"]{color:#ffe1a5;border-color:#d6af68}
.react-grid-editor-lock:focus-visible,.react-grid-editor-size-options button:focus-visible,.react-grid-editor-library-item:focus-visible{outline:3px solid #c7e9ff!important;outline-offset:2px}
.react-grid-editor-tile-main{padding-top:25px!important}

.react-grid-editor-content:has(>.react-grid-editor-scroller){flex-wrap:wrap}
.react-grid-editor-presets{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 12px}
.react-grid-editor-presets button{min-height:35px;font-size:.75rem}
.react-grid-editor-library>label{display:grid;gap:5px;font-size:.75rem}
.react-grid-editor-library>label select{min-height:42px;max-width:100%}

.react-grid-editor-library-toggle{display:none;min-height:44px;text-align:left;width:100%;font-weight:600}
@media(max-width:720px){
 .react-grid-editor-library-toggle{display:block}
 .react-grid-editor-library.collapsed{max-height:none;overflow:visible}
 .react-grid-editor-library.collapsed .react-grid-editor-library-body{display:none}
}

/* Layout-editor tiles are full visual cards. Only the title is the drag
   handle: the transparent size controls must never erase the tile surface. */
.react-grid-editor-tile {
  box-sizing:border-box;
  border:1px solid #bda066!important;
  border-radius:3px;
  background:linear-gradient(145deg,#1e3649,#0c1822)!important;
  box-shadow:0 2px 5px rgba(0,0,0,.32);
  overflow:hidden;
}
.react-grid-editor-tile.selected {
  border:2px solid #56aeed!important;
  box-shadow:0 0 0 1px rgba(86,174,237,.23),0 2px 6px rgba(0,0,0,.38);
}
.react-grid-editor-tile.dragging {
  box-shadow:0 8px 20px rgba(0,0,0,.54);
}
.react-grid-editor-tile>.react-grid-editor-tile-main{
  position:absolute;top:2px;left:3px;right:36px;width:calc(100% - 39px);
  height:30px;min-height:30px!important;
  display:flex;justify-content:center;align-items:center;
  padding:2px 3px!important;text-align:center;
  background:none!important;border:0!important;box-shadow:none!important;
  border-radius:0;overflow:hidden;cursor:grab;
}
.react-grid-editor-tile>.react-grid-editor-tile-main b{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;font-size:.68rem;line-height:1.15;max-width:100%;
}
.react-grid-editor-tile.selected>.react-grid-editor-tile-main{
  border:0!important;text-decoration:underline;
  text-decoration-color:#56aeed;text-underline-offset:3px;
}
.react-grid-editor-tile>.react-grid-editor-size-options{
  position:absolute;z-index:2;
  top:35px;bottom:auto;left:3px;right:3px;min-width:0;max-width:none;
  display:flex;flex-direction:column;align-items:center;gap:2px;
}
.react-grid-editor-tile>.react-grid-editor-size-options button{
  appearance:none;
  display:block;width:auto;min-width:44px;min-height:21px!important;
  line-height:1.15!important;padding:2px 7px!important;
  font-size:.72rem;font-weight:600;text-align:center;
  color:#e6e0d4!important;
  background:none!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;text-shadow:none!important;
  white-space:nowrap;cursor:pointer;
}
.react-grid-editor-tile>.react-grid-editor-size-options button:hover:not(:disabled),
.react-grid-editor-tile>.react-grid-editor-size-options button:focus-visible{
  color:#fff3ce!important;background:none!important;border:0!important;
  text-decoration:underline;text-underline-offset:2px;
}
.react-grid-editor-tile>.react-grid-editor-size-options button[aria-pressed="true"]{
  color:#ffdfa7!important;background:none!important;border:0!important;
  font-weight:800;text-decoration:underline;
  text-decoration-color:#d2b579;text-decoration-thickness:2px;
  text-underline-offset:3px;
}
.react-grid-editor-tile>.react-grid-editor-size-options button:disabled{opacity:.55;cursor:default}
/* At two grid rows tall, four dimensions must remain inside the same tile
   instead of overlapping the adjacent panel. */
.react-grid-editor-tile[data-grid-tile-rows="2"]>.react-grid-editor-size-options{
  top:32px;gap:1px;
}
.react-grid-editor-tile[data-grid-tile-rows="2"]>.react-grid-editor-size-options button{
  min-height:16px!important;font-size:.68rem;line-height:1!important;
  padding:0 5px!important;
}
@media (max-width:720px){
  .react-grid-editor-tile>.react-grid-editor-size-options button{
    min-height:21px!important;
  }
  .react-grid-editor-tile[data-grid-tile-rows="2"]>.react-grid-editor-size-options button{
    min-height:16px!important;
  }
}
