/* ═══ Tool-specific styles ═══ */
.container-wide{max-width:none}

/* HAR analyzer */
.har-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.har-file{display:flex;align-items:center;gap:8px;min-width:0}
.har-file strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:420px}
#har-stats{margin-bottom:16px}
.har-views{margin-bottom:14px}
.har-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:12px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip.s2{--c:var(--ok)} .chip.s3{--c:var(--warn)} .chip.s4,.chip.s5,.chip.s0{--c:var(--err)}
.har-split{display:grid;grid-template-columns:minmax(0,1fr) clamp(320px,28vw,640px);gap:14px;align-items:start}
.har-table-wrap{max-height:calc(100vh - 150px);min-height:300px;overflow:auto}
.har-table{table-layout:fixed;width:100%}
.har-table th{position:sticky;top:0;overflow:hidden;text-overflow:ellipsis;padding-right:14px}
.col-grip{position:absolute;top:0;right:0;width:9px;height:100%;cursor:col-resize;touch-action:none;z-index:2}
.col-grip::after{content:"";position:absolute;top:22%;bottom:22%;right:4px;width:1px;background:var(--border-strong)}
.col-grip:hover::after,body.col-resizing .col-grip::after{background:var(--brand);width:2px}
body.col-resizing{cursor:col-resize;user-select:none}
.colmenu{position:fixed;z-index:120;min-width:210px;max-height:min(70vh,560px);overflow:auto;padding:6px;box-shadow:var(--shadow-lg)}
.cm-item{display:flex;align-items:center;gap:10px;margin:0;padding:6px 10px;border-radius:6px;font-size:.88rem;font-weight:500;color:var(--text);cursor:pointer}
.cm-item:hover{background:var(--surface-2)}
.cm-item input{accent-color:var(--brand);width:15px;height:15px}
.cm-fixed{opacity:.6;cursor:default}
.cm-sep{border-top:1px solid var(--border);margin:6px 0}
.cm-btn{width:100%;text-align:left;border:0;background:none;padding:7px 10px;border-radius:6px;font:inherit;font-size:.88rem;color:var(--text);cursor:pointer}
.cm-btn:hover{background:var(--surface-2)}
.chip.zero{opacity:.5}
.chip.on .n{opacity:.8}
.har-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.har-table tbody tr{cursor:pointer}
.har-table tbody tr.sel td{background:var(--brand-soft)!important}
.har-table tbody tr.redir td.col-name .nm{color:var(--warn)}
.har-table tbody tr.bad td.col-name .nm{color:var(--err)}
.har-table .nm{display:block;overflow:hidden;text-overflow:ellipsis}
.har-table .dm{display:block;font-size:.75rem;color:var(--text-3);overflow:hidden;text-overflow:ellipsis}
.st{display:inline-block;min-width:38px;text-align:center;padding:1px 6px;border-radius:6px;font-weight:700;font-size:.78rem;font-variant-numeric:tabular-nums}
.st-2{background:var(--ok-bg);color:var(--ok)} .st-3{background:var(--warn-bg);color:var(--warn)}
.st-4,.st-5,.st-0{background:var(--err-bg);color:var(--err)} .st-1{background:var(--surface-2);color:var(--text-2)}
.m{font-weight:700;font-size:.78rem} .m-GET{color:#16a34a} .m-POST{color:#ea580c} .m-PUT,.m-PATCH{color:#7c3aed} .m-DELETE{color:#dc2626} .m-OPTIONS{color:#2563eb}
.wf{position:relative;height:10px;background:var(--surface-2);border-radius:3px}
.wf span{position:absolute;top:0;height:10px;border-radius:3px;min-width:2px;background:linear-gradient(90deg,#60a5fa,#2563eb)}
.wf span.slow{background:linear-gradient(90deg,#fbbf24,#f97316)} .wf span.err{background:linear-gradient(90deg,#f87171,#dc2626)}
.har-more,.har-empty{padding:14px;text-align:center}
.har-detail{position:sticky;top:calc(var(--header-h) + 12px);max-height:calc(100vh - var(--header-h) - 24px);display:flex;flex-direction:column;overflow:hidden}
.har-detail-empty{padding:40px 20px;text-align:center}
.hd-head{padding:14px 16px;border-bottom:1px solid var(--border)}
.hd-url{display:flex;gap:6px;align-items:flex-start}
.hd-url code{flex:1;word-break:break-all;font-size:.8rem;line-height:1.45;max-height:4.4em;overflow:hidden}
.hd-url code.open{max-height:none}
.hd-tabs{display:flex;flex-wrap:wrap;gap:0;padding:4px 8px 0;border-bottom:1px solid var(--border)}
.hd-tabs button{border:0;background:none;padding:8px 8px;font:inherit;font-size:.84rem;font-weight:600;color:var(--text-3);cursor:pointer;border-bottom:2px solid transparent;white-space:nowrap}
.hd-tabs button.on{color:var(--text);border-bottom-color:var(--brand)}
.hd-body{padding:14px 16px;overflow:auto;flex:1}
.kv{display:grid;grid-template-columns:minmax(110px,38%) 1fr;gap:6px 12px;font-size:.84rem;margin:0}
.kv dt{color:var(--text-3);font-weight:500;word-break:break-word}
.kv dd{margin:0;word-break:break-all;font-family:var(--mono);font-size:.8rem}
.hd-sec{margin-bottom:18px}
.hd-sec h4{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);margin:0 0 8px;display:flex;justify-content:space-between;align-items:center}
.findings{display:flex;flex-wrap:wrap;gap:6px}
.tbar{display:flex;height:14px;border-radius:4px;overflow:hidden;background:var(--surface-2);margin:6px 0 12px}
.tbar span{height:100%}
.t-blocked{background:#94a3b8} .t-dns{background:#14b8a6} .t-connect{background:#f59e0b} .t-ssl{background:#a855f7}
.t-send{background:#0ea5e9} .t-wait{background:#22c55e} .t-receive{background:#3b82f6}
.tleg{display:grid;grid-template-columns:14px 1fr auto;gap:6px 8px;align-items:center;font-size:.84rem}
.tleg i{width:12px;height:12px;border-radius:3px;display:block}
.body-pre{background:var(--code-bg);color:var(--code-text);border-radius:8px;padding:12px;font-family:var(--mono);font-size:.78rem;white-space:pre-wrap;word-break:break-all;max-height:420px;overflow:auto;margin:0}
.preview-img{max-width:100%;max-height:300px;border:1px solid var(--border);border-radius:8px;background:repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 50%/16px 16px}
.issue-list{display:flex;flex-direction:column;gap:8px}
.issue{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);cursor:pointer;font-size:.88rem}
.issue:hover{border-color:var(--border-strong)}
.issue .u{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.8rem}
.chain{border:1px solid var(--border);border-radius:10px;padding:12px;margin-bottom:10px;background:var(--surface)}
.chain ol{margin:0;padding-left:20px;font-size:.84rem}
.chain li{margin:4px 0;word-break:break-all}
.chain.loop{border-color:var(--err)}

/* MTR */
.mtr-form{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:18px}
.mtr-results{display:flex;flex-direction:column;gap:16px;margin-top:20px}
.mtr-card .card-head{flex-wrap:wrap}
.mtr-card .meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.84rem;color:var(--text-2);padding:12px 18px;border-bottom:1px solid var(--border)}
.mtr-card .meta b{color:var(--text);font-weight:600}
.loss-0{color:var(--ok)} .loss-lo{color:var(--warn)} .loss-hi{color:var(--err);font-weight:700}
.lat{display:inline-block;height:6px;border-radius:3px;background:linear-gradient(90deg,#22c55e,#eab308,#ef4444);vertical-align:middle}
.spinner{width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;display:inline-block;animation:spin .8s linear infinite;vertical-align:middle}
@keyframes spin{to{transform:rotate(360deg)}}
.progress{height:4px;background:var(--surface-2);border-radius:2px;overflow:hidden}
.progress span{display:block;height:100%;background:linear-gradient(90deg,var(--brand),var(--brand-2));transition:width .3s}

/* JWT / encoder */
.io-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.jwt-colored{font-family:var(--mono);font-size:.86rem;word-break:break-all;line-height:1.6;padding:12px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border)}
.jwt-h{color:#e11d48} .jwt-p{color:#7c3aed} .jwt-s{color:#0891b2}
[data-theme="dark"] .jwt-h{color:#fb7185} [data-theme="dark"] .jwt-p{color:#c4a5ff} [data-theme="dark"] .jwt-s{color:#67e8f9}
.claims td:first-child{font-family:var(--mono);font-weight:600;white-space:nowrap}

@media (max-width:1100px){
  .har-split{grid-template-columns:1fr}
  .har-detail{position:static;max-height:none}
  .har-table-wrap{max-height:60vh}
}
@media (max-width:760px){
  .mtr-form,.io-grid{grid-template-columns:1fr}
}

/* Images view */
.img-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.img-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.img-card{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:10px;background:var(--surface);overflow:hidden;cursor:pointer;padding:0;text-align:left;font:inherit;color:var(--text)}
.img-card:hover{border-color:var(--brand)}
.img-thumb{height:120px;display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(var(--surface-3) 0 25%,var(--surface) 0 50%) 50%/16px 16px}
.img-thumb img{max-width:100%;max-height:120px;object-fit:contain}
.img-miss{font-size:.75rem;color:var(--text-3);padding:8px;text-align:center}
.img-meta{padding:8px 10px;display:flex;flex-direction:column;gap:2px;min-width:0}
.img-meta .nm{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.img-meta .dm{font-size:.72rem;color:var(--text-3)}
/* Preview tab */
.pv-img{text-align:center}
.pv-frame{width:100%;height:420px;border:1px solid var(--border);border-radius:8px;background:#fff}
.pv-font{font-size:1.4rem;line-height:1.6;word-break:break-word}
.pv-media{width:100%}
.json-tree{font-family:var(--mono);font-size:.8rem;line-height:1.6}
.json-tree details{margin-left:14px}
.json-tree>details{margin-left:0}
.json-tree summary{cursor:pointer;color:var(--text-3)}
.j-row{margin-left:14px;word-break:break-all}
.j-key{color:var(--info)} .j-str{color:var(--ok)} .j-num{color:var(--warn)} .j-bool,.j-null{color:#a855f7}

/* Once a HAR is open, keep only the breadcrumb at the top so the results get the space */
body.har-loaded .har-intro{display:none}
body.har-loaded .page-head{padding:14px 0 10px}
body.har-loaded .page-head .crumbs{margin-bottom:0}
