/* v2026.08.08c Platform Controls desktop layout + Trading Audit modal stacking hotfix.
   UI-only. No trading logic or Worker behavior changes. */

/* The Trading Audit is launched from inside the Platform Controls overlay.
   Keep it above Platform Controls instead of behind it. */
.ta-overlay{
  z-index:2147483600;
}

/* Advanced/Developer exposes many Platform tabs. On desktop, wrap them onto
   clean rows rather than forcing one very long horizontal strip. */
@media (min-width:901px){
  .pc-panel > nav{
    flex-wrap:wrap;
    overflow-x:visible;
    align-items:center;
    row-gap:7px;
  }
  .pc-panel > nav button{
    flex:0 0 auto;
  }

  /* The guided workspace toolbar contains a title, level switch, then a
     workspace/search/pin control row. The original toolbar was flex, while
     its child expected grid placement, which compressed all controls into
     one line. Give the Platform shell an explicit two-row grid. */
  .phase5h-toolbar.phase5h-pc-shell{
    display:grid;
    grid-template-columns:minmax(220px,1fr) auto;
    align-items:start;
    gap:10px 14px;
  }
  .phase5h-pc-shell > .phase5h-toolbar-title{
    min-width:220px;
  }
  .phase5h-pc-shell > .phase5h-level-switch{
    justify-self:end;
  }
  .phase5h-pc-shell > .phase5h-pc-controls{
    grid-column:1 / -1;
    width:100%;
    min-width:0;
    grid-template-columns:minmax(440px,1.15fr) minmax(280px,.75fr) auto;
  }
  .phase5h-pc-shell .phase5h-pc-workspaces{
    min-width:0;
  }
  .phase5h-pc-shell .phase5h-search{
    min-width:0;
    width:100%;
  }
  .phase5h-pc-shell > .phase5h-pins{
    grid-column:1 / -1;
  }
}

/* Intermediate desktop/tablet widths get a comfortable two-stage controls
   row without returning to the compressed layout. */
@media (min-width:721px) and (max-width:1100px){
  .phase5h-pc-shell > .phase5h-pc-controls{
    grid-template-columns:1fr auto;
  }
  .phase5h-pc-shell .phase5h-pc-workspaces{
    grid-column:1 / -1;
    grid-template-columns:repeat(4,minmax(105px,1fr));
  }
  .phase5h-pc-shell .phase5h-search{
    grid-column:1;
  }
  .phase5h-pc-shell .phase5h-pin-current{
    grid-column:2;
  }
}

/* Make the injected Trading Audit launch unmistakably interactive. */
.pc-panel > nav [data-trading-audit-launch]{
  cursor:pointer;
  position:relative;
  z-index:1;
}
.pc-ui-hotfix-badge{display:inline-block;margin-left:8px;padding:2px 6px;border:1px solid #5865f288;border-radius:999px;color:#aeb5ff;font:800 9px Inter,system-ui,sans-serif;letter-spacing:.04em;vertical-align:middle}


/* v2026.08.08f fail-visible Platform Controls loader. Never leave a bare blurred overlay when an API request fails. */
.pc-load-shell{min-height:280px}
.pc-load-state{margin:22px;padding:28px;border:1px solid #303743;border-radius:12px;background:#1b1f26;display:flex;align-items:center;gap:16px}
.pc-load-state h3{margin:0 0 6px;font-size:16px}.pc-load-state p{margin:0;color:#9aa3b2;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.pc-load-icon{width:42px;height:42px;flex:0 0 42px;border:1px solid #4b5666;border-radius:50%;display:grid;place-items:center;color:#aeb5ff;font-size:22px;font-weight:900}
.pc-load-state.error{border-color:#71404a;background:#27181d}.pc-load-state.error .pc-load-icon{border-color:#8b4c58;color:#ff8a96}
.pc-load-actions{display:flex;gap:10px;padding:0 22px 22px}.pc-load-actions button{min-height:42px;padding:0 16px;border:1px solid #5865f2;border-radius:8px;background:#5865f2;color:#fff;font-weight:800;cursor:pointer}.pc-load-actions button.secondary{border-color:#3a404b;background:#20242b;color:#d7dce5}
