  :root{
    color-scheme: dark;
    --bg:#020617;
    --panel:rgba(2,6,23,.88);
    --panel2:rgba(15,23,42,.92);
    --border:rgba(51,65,85,.9);
    --muted:#9ca3af;
    --text:#e5e7eb;
    --accent:#38bdf8;
    --good:#22c55e;
    --warn:#fbbf24;
    --bad:#f97316;
    --r:18px;
    --shadow:0 18px 40px rgba(15,23,42,.9), 0 0 0 1px rgba(15,23,42,.9);
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  }
  /* === SHARED NAV BUTTONS (EllaHub, Ops, Designer, App) === */
.nav-btn {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.9);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  transition: background .12s ease, transform .12s ease;
}

.nav-btn:hover {
  background: rgba(15,23,42,.92);
}
*{box-sizing:border-box;}

  html, body{height:100%;margin:0;overflow:hidden;}
  body{
    background: radial-gradient(circle at top, #0b1228 0%, var(--bg) 40%, var(--bg) 100%);
    color:var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .wrap{
    max-width:1880px;
    margin:0 auto;
    padding:18px 16px 18px;
    height:100vh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }

  header{
    flex:0 0 auto;
    display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
    margin:0 0 14px 0;
  }
  .brand h1{margin:0; font-size:1.15rem; letter-spacing:.22em; text-transform:uppercase;}
  .brand .sub{margin-top:4px; color:var(--muted); font-size:.78rem; letter-spacing:.12em; text-transform:uppercase;}
  .hdr-right{display:flex; flex-direction:column; align-items:flex-end; gap:6px; font-size:.82rem;}

  .pill{
    display:inline-flex; align-items:center; gap:6px;
    padding:2px 8px; border-radius:999px;
    border:1px solid rgba(148,163,184,.8);
    background:rgba(15,23,42,.75);
    color:var(--text);
    font-size:.74rem;
    letter-spacing:.08em;
    text-transform:uppercase;
  }
  .dot{width:8px;height:8px;border-radius:999px;background:#64748b;}
  .dot.ok{background:var(--good);}
  .dot.warn{background:var(--warn);}
  .dot.bad{background:var(--bad);}

  .btn,.btn-outline,.btn-danger{
    font-size:.78rem;
    padding:6px 10px;
    border-radius:999px;
    border:none;
    cursor:pointer;
    letter-spacing:.08em;
    text-transform:uppercase;
    white-space:nowrap;
    transition:transform .12s ease, box-shadow .12s ease, background .12s ease, opacity .12s ease;
  }
  .btn{
    background:linear-gradient(135deg,#0ea5e9,#22d3ee);
    color:#0f172a;
    font-weight:800;
    border:1px solid rgba(125,211,252,.8);
    box-shadow:0 10px 30px rgba(8,47,73,.75);
  }
  .btn:hover{transform:translateY(-1px); box-shadow:0 14px 40px rgba(8,47,73,.9);}
  .btn-outline{
    background:transparent;
    color:var(--text);
    border:1px solid rgba(148,163,184,.9);
  }
  .btn-outline:hover{background:rgba(15,23,42,.92);}
  .btn-danger{
    background:rgba(127,29,29,.95);
    color:#fee2e2;
    border:1px solid rgba(239,68,68,.9);
  }
  .btn-danger:hover{background:rgba(185,28,28,1);}

  .card{
    border-radius:var(--r);
    padding:12px 12px 10px;
    background:rgba(2,6,23,.88);
    border:1px solid var(--border);
    box-shadow:var(--shadow);
    overflow:hidden;
    min-height:0;
  }

  .layout{
    flex:1 1 auto;
    min-height:0;
    overflow:hidden;
    display:flex;
    gap:14px;
  }

  .heading{
    font-size:.8rem;
    letter-spacing:.14em;
    text-transform:uppercase;
    font-weight:900;
    margin:0 0 6px 0;
  }
  .muted{color:var(--muted); font-size:.78rem; line-height:1.35;}
  .status{margin-top:6px; font-size:.78rem; color:var(--muted);}
  .status.ok{color:#4ade80;}
  .status.warn{color:#fbbf24;}
  .status.error{color:#fca5a5;}

  input,select,textarea{
    width:100%;
    padding:7px 9px;
    border-radius:10px;
    border:1px solid rgba(55,65,81,.9);
    background:rgba(15,23,42,.9);
    color:var(--text);
    font-size:.8rem;
    outline:none;
  }
  textarea{resize:none;}
  .label{font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin-bottom:4px;}

  .ops-split{
    display:grid;
    grid-template-columns: minmax(320px, 28%) minmax(0, 72%);
    gap:12px;
    height:100%;
    min-height:0;
  }
  .ops-left{display:flex; flex-direction:column; gap:10px; min-height:0; overflow:hidden;}
  .ops-right{
    min-height:0;
    overflow:hidden;
    display:grid;
    grid-template-rows: 1fr 240px;
    gap:10px;
  }

  .ops-box{
    border-radius:10px;
    border:1px solid rgba(30,41,59,.9);
    background:rgba(15,23,42,.92);
    padding:8px;
    min-height:0;
    overflow:hidden;
  }

  /* OPS_TREE_SCROLL_FIX_V1 */
.ops-left { min-height: 0; }
#ops-tree-box { min-height: 0; overflow: auto !important; }
#ops-tree { min-height: 0; height: auto !important; max-height: none !important; overflow: auto !important; }

#ops-tree{
    height:100%;
    min-height:0;
    overflow:auto;
    padding:6px 8px;
    font-size:.78rem;
    border-radius:10px;
    border:1px solid rgba(30,41,59,.9);
    background:rgba(15,23,42,.95);
  }

/* OPS_TREE_CLICK_FIX_V2 */
#ops-tree-box{
  position: relative;
  z-index: 10;
}
#ops-tree{
  position: relative;
  z-index: 11;
  pointer-events: auto;
}

#ops-monaco-editor{
    margin-top:8px;
    flex:1;
    min-height:0;
    border-radius:10px;
    border:1px solid rgba(30,41,59,.9);
    overflow:hidden;
    background:rgba(15,23,42,.95);
    height:100%;
  }

  .badge{
    display:inline-flex; align-items:center;
    padding:2px 7px;
    border-radius:999px;
    font-size:.68rem;
    text-transform:uppercase;
    letter-spacing:.08em;
    border:1px solid rgba(148,163,184,.8);
  }
  .badge.green{border-color:rgba(34,197,94,.7); color:#bbf7d0; background:rgba(22,163,74,.22);}
  .badge.red{border-color:rgba(248,113,113,.7); color:#fecaca; background:rgba(127,29,29,.22);}
  .badge.warn{border-color:rgba(251,191,36,.7); color:#fde68a; background:rgba(245,158,11,.18);}

  .findbar{margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; align-items:center;}
  .findbar input{max-width:320px;}
  .findcount{font-size:.78rem; color:var(--muted);}

  /* Create modal shell */
  #ops-create-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:20050;
    background:rgba(0,0,0,0.55);
    backdrop-filter:blur(4px);
    padding:18px;
  }
  #ops-create-modal .inner{
    max-width:980px;
    margin:0 auto;
    height:78vh;
    border-radius:18px;
    border:1px solid rgba(51,65,85,0.9);
    background:rgba(2,6,23,0.98);
    box-shadow:0 30px 80px rgba(0,0,0,0.75);
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }

  /* TASK REVIEW MODAL */
  #ops-task-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:21000;
    background:rgba(0,0,0,0.60);
    backdrop-filter:blur(6px);
    padding:18px;
  }
  #ops-task-modal .inner{
    width:96vw;
    height:92vh;
    margin:0 auto;
    border-radius:18px;
    border:1px solid rgba(51,65,85,0.9);
    background:rgba(2,6,23,0.98);
    box-shadow:0 30px 80px rgba(0,0,0,0.75);
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }
  #ops-task-modal .topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border-bottom:1px solid rgba(30,41,59,0.9);
  }
  #ops-task-modal .grid{
    flex:1;
    min-height:0;
    display:grid;
    grid-template-columns: minmax(320px, 34%) minmax(0, 66%);
    gap:12px;
    padding:12px 14px;
    overflow:hidden;
  }
  #ops-task-modal .panel{
    border-radius:14px;
    border:1px solid rgba(30,41,59,.9);
    background:rgba(15,23,42,.92);
    padding:10px;
    min-height:0;
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }
  #ops-task-modal pre{
    margin:0;
    white-space:pre-wrap;
    word-break:break-word;
    font-family:var(--mono);
    font-size:.75rem;
    color:#cbd5e1;
    overflow:auto;
    flex:1;
    min-height:0;
  }
  #ops-task-preview{
    width:100%;
    height:100%;
    border:1px solid rgba(30,41,59,.9);
    border-radius:12px;
    background:rgba(15,23,42,.95);
  }

  /* TASKS MODAL */
  #ops-tasks-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:25000;
    background:rgba(0,0,0,.62);
    backdrop-filter:blur(6px);
    padding:18px;
  }

  /* ARCHIVED TASKS MODAL */
  #ops-archived-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:25010;
    background:rgba(0,0,0,.62);
    backdrop-filter:blur(6px);
    padding:18px;
  }
  
  .fullscreen-editor-mode{
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
    overflow:hidden;
}

.ops-editor-topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:10px;
    border:1px solid rgba(30,41,59,.9);
    border-radius:12px;
    background:rgba(15,23,42,.92);
    margin-bottom:10px;
}

.ops-editor-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.ops-editor-main{
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
    border:1px solid rgba(30,41,59,.9);
    border-radius:12px;
    overflow:hidden;
}

/* =========================================
   OPS FULLSCREEN EDITOR LAYOUT
========================================= */

.ops-split{
    display:flex;
    flex-direction:row;
    gap:12px;
    flex:1;
    min-height:0;
    overflow:hidden;
}

.ops-left{
    width:320px;
    min-width:320px;
    max-width:320px;

    display:flex;
    flex-direction:column;
    gap:10px;

    overflow:auto;

    border-right:1px solid rgba(30,41,59,.9);
    padding-right:10px;
}

.ops-right{
    display:flex;
    flex-direction:column;
    flex:1;
    min-width:0;
    min-height:0;
}

#ops-monaco-editor{
    flex:1;
    min-height:0;
    width:100%;
}

/* Bigger editor area */
.ops-editor-main{
    flex:1;
    min-height:0;
    height:100%;
}

/* Reduce wasted space */
.wrap{
    padding:10px 14px;
}

.layout{
    gap:10px;
}

/* Better modal scaling */
#ops-create-modal .inner,
#ops-task-modal .inner{
    width:min(1600px, 96vw);
    height:92vh;
}

/* =========================================
   MINIMIZED LEFT PANEL
========================================= */

.minimized-left-panel{
    width:90px;
    min-width:90px;
    max-width:90px;

    display:flex;
    flex-direction:column;
    overflow:hidden;

    border-right:1px solid rgba(30,41,59,.9);
    padding-right:10px;
}

.ops-mini-panel{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.ops-mini-panel button{
    width:100%;
}

/* =========================================
   TREE MODAL
========================================= */

#ops-tree-modal{
    position:fixed;
    inset:0;

    background:rgba(0,0,0,.72);

    display:none;

    align-items:center;
    justify-content:center;

    z-index:999999;
}

#ops-tree-modal .inner{
    width:min(1600px, 96vw);
    height:92vh;

    border-radius:18px;
    border:1px solid rgba(51,65,85,.9);

    background:rgba(2,6,23,.98);

    overflow:hidden;

    display:flex;
    flex-direction:column;
}

#ops-tree-modal .topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:12px 14px;

    border-bottom:1px solid rgba(30,41,59,.9);
}

/* =========================================
   FLOATING OPS WINDOWS
========================================= */

.ops-floating-window{
    position:fixed;

    top:120px;
    left:120px;

    width:900px;
    height:700px;

    background:rgba(2,6,23,.98);

    border:1px solid rgba(51,65,85,.9);
    border-radius:18px;

    box-shadow:0 30px 80px rgba(0,0,0,.75);

    overflow:hidden;

    display:none;
    flex-direction:column;

    resize:both;

    z-index:50000;
}

.ops-floating-window.active{
    display:flex;
}

.ops-floating-header{
    height:52px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:0 14px;

    border-bottom:1px solid rgba(30,41,59,.9);

    background:rgba(15,23,42,.98);

    cursor:move;

    user-select:none;
}

.ops-floating-title{
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.12em;
    text-transform:uppercase;
}

.ops-floating-body{
    flex:1;
    min-height:0;

    overflow:auto;

    padding:12px;
}

.ops-floating-actions{
    display:flex;
    gap:8px;
    align-items:center;
}