*{box-sizing:border-box}
:root{
    --green:#126b45;
    --green-dark:#0b4f34;
    --green-light:#e9f4ef;
    --text:#1d2923;
    --muted:#6a756f;
    --border:#dce3df;
    --bg:#f4f6f5;
    --white:#fff;
}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
.topbar{min-height:76px;background:#1b3a5c;color:#fff;padding:14px 28px;display:flex;justify-content:space-between;align-items:center;gap:20px}
.eyebrow{font-size:11px;letter-spacing:1.7px;opacity:.72;margin-bottom:4px}
h1{font-size:22px;margin:0;font-weight:650}
.top-actions{display:flex;align-items:center;gap:10px}
.file-badge{font-size:13px;background:rgba(255,255,255,.12);padding:8px 12px;border-radius:6px}
.page{padding:22px 28px}
.alert{padding:12px 15px;border-radius:8px;margin-bottom:18px}
.alert.error{background:#fdecec;color:#9d2424;border:1px solid #f2c9c9}
.alert.success{background:#eaf7ef;color:#176b3c;border:1px solid #cce8d6}
.upload-card{max-width:720px;margin:70px auto;background:#fff;border:1px solid var(--border);border-radius:14px;padding:48px;text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.04)}
.upload-icon{width:58px;height:58px;border-radius:50%;background:var(--green-light);color:var(--green);display:flex;align-items:center;justify-content:center;margin:0 auto 18px;font-size:30px}
.upload-card h2{margin:0 0 10px;font-size:25px}
.upload-card p{color:var(--muted)}
.columns{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:22px 0 28px}
.columns span{background:#f1f4f2;border:1px solid var(--border);padding:8px 12px;border-radius:6px;font-family:monospace;font-size:13px}
.upload-form{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.file-input{position:relative;overflow:hidden;display:inline-flex;align-items:center;padding:11px 16px;border:1px solid var(--border);border-radius:7px;background:#fff;cursor:pointer}
.file-input input{position:absolute;inset:0;opacity:0;cursor:pointer}
.button,.tool-button{border:1px solid var(--border);background:#fff;border-radius:7px;padding:10px 14px;font-size:14px;cursor:pointer;color:var(--text)}
.button:hover,.tool-button:hover{background:#f1f4f2}
.button-primary,.tool-button.primary{background:var(--green);color:#fff;border-color:var(--green)}
.button-primary:hover,.tool-button.primary:hover{background:var(--green-dark)}
.button-light{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.25)}
.inline-form{margin:0}
.hint{font-size:12px;margin-top:22px}
.toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:10px}
.toolbar-group{display:flex;gap:6px;align-items:center}
.tool-button{padding:8px 11px}
.search{height:36px;width:270px;border:1px solid var(--border);border-radius:7px;padding:0 11px;font-size:14px;outline:none}
.search:focus{border-color:var(--green)}
.stats{font-size:13px;color:var(--muted);padding:5px 3px 9px}
.canvas-wrap{height:calc(100vh - 190px);min-height:550px;background:#fff;border:1px solid var(--border);border-radius:10px;overflow:hidden;position:relative;cursor:grab}
.canvas-wrap.dragging{cursor:grabbing}
#orgChart{width:100%;height:100%;display:block;background:#fbfcfb}
.node-card{filter:drop-shadow(0 2px 2px rgba(0,0,0,.08))}
.node-card rect{fill:#fff;stroke:#bfc9c4;stroke-width:1.2}
.node-card.highlight rect{stroke:var(--green);stroke-width:2.5}
.node-card.dim{opacity:.25}
.node-name{font-size:14px;font-weight:700;fill:#1d2923}
.node-role{font-size:11.5px;fill:#647069}
.node-id{font-size:9px;fill:#9aa39e}
.connector{fill:none;stroke:#b8c3bd;stroke-width:1.3}
.detail-panel{position:fixed;right:20px;top:95px;width:330px;max-width:calc(100vw - 40px);background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 35px rgba(0,0,0,.15);padding:22px;display:none;z-index:10}
.detail-panel.open{display:block}
.detail-close{position:absolute;right:10px;top:8px;border:0;background:transparent;font-size:25px;color:#777;cursor:pointer}
.detail-panel h3{margin:0 28px 6px 0;font-size:20px}
.detail-panel .role{color:var(--muted);line-height:1.4}
.detail-meta{border-top:1px solid var(--border);margin-top:16px;padding-top:13px;font-size:13px}
@media(max-width:800px){
    .topbar{padding:14px 16px}
    .page{padding:12px}
    .toolbar{flex-direction:column;align-items:stretch}
    .toolbar-group{flex-wrap:wrap}
    .search{width:100%}
    .canvas-wrap{height:calc(100vh - 255px);min-height:450px}
    .upload-card{margin:30px auto;padding:28px 20px}
}
