/* hy-triage: ME.exe in a pestudio-style triage window. */

.hyr{
  /* Status colours are fixed so "resolved" stays green and "patch" stays red in every theme. */
  --hyr-ok:oklch(.78 .15 150);
  --hyr-watch:oklch(.82 .14 80);
  --hyr-patch:oklch(.7 .18 28);
  margin:2.4rem 0;
  background:var(--code);
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  font-family:var(--mono);
  box-shadow:0 18px 44px color-mix(in oklab,var(--shadow) 55%,transparent);
}
[data-theme="paper"] .hyr{--hyr-ok:oklch(.48 .13 150);--hyr-watch:oklch(.52 .12 70);--hyr-patch:oklch(.52 .2 28)}
.prose .hyr ul,.prose .hyr ol{padding-left:0}
.prose .hyr li+li{margin-top:0}
.prose .hyr li::marker{content:none}
.hyr-titlebar{display:flex;align-items:center;gap:.7rem;padding:.5rem .75rem;background:var(--surface2);border-bottom:1px solid var(--line);min-width:0}
.hyr-dots{display:flex;gap:.28rem;flex:none}
.hyr-dots i{width:.55rem;height:.55rem;border-radius:50%;background:var(--accent3)}
.hyr-dots i:nth-child(2){background:var(--accent2)}
.hyr-dots i:nth-child(3){background:var(--accent)}
.hyr-title{color:var(--muted);font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.hyr-badge{margin-left:auto;flex:none;padding:.05rem .4rem;border:1px solid var(--line);border-radius:4px;color:var(--accent2);font-size:.6rem;letter-spacing:.08em;text-transform:uppercase}

.hyr-nojs{padding:1rem}
.hyr-nojs-head{margin:0 0 .5rem;color:var(--accent);font-size:.78rem}
.hyr-nojs-pre{margin:0 0 .8rem;padding:0;background:none;border:0;color:var(--fg);font-size:.74rem;white-space:pre;overflow-x:auto}

.hyr-app{display:grid;grid-template-columns:9.5rem minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;height:30rem}
.hyr-tabs{grid-row:1;display:flex;flex-direction:column;gap:.15rem;padding:.45rem .35rem;border-right:1px solid var(--line);background:color-mix(in oklab,var(--surface) 35%,var(--code))}
.hyr-tab{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.42rem .55rem;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:.76rem;text-align:left;cursor:pointer}
.hyr-tab::before{content:"▸";margin-right:.15rem;opacity:0}
.hyr-tab-label{flex:1}
.hyr-tab:hover{background:var(--surface2);border-color:var(--line);color:var(--fg)}
.hyr-tab[aria-selected="true"]{background:color-mix(in oklab,var(--accent) 15%,transparent);border-color:color-mix(in oklab,var(--accent) 55%,var(--line));color:var(--fg)}
.hyr-tab[aria-selected="true"]::before{opacity:1;color:var(--accent)}
.hyr-tab:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.hyr-tab-count{min-width:1.3rem;padding:0 .3rem;border-radius:999px;font-size:.62rem;text-align:center;font-variant-numeric:tabular-nums;color:var(--fg);background:var(--surface2)}
.hyr-tab-count:empty{display:none}
.hyr-tab-count.is-hot{background:var(--hyr-patch);color:var(--code)}

.hyr-panels{grid-row:1;min-width:0;min-height:0;display:flex}
.hyr-panel{flex:1;min-width:0;overflow-y:auto;padding:.7rem .85rem;scrollbar-width:thin}
.hyr-panel:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.hyr-panel[hidden]{display:none}

.hyr-foot{grid-column:1 / -1;display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.45rem .75rem;border-top:1px solid var(--line);background:var(--surface2)}
.hyr-status{flex:1;min-width:12rem;margin:0;color:var(--muted);font-size:.7rem}
.hyr-btn{padding:.3rem .65rem;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--fg);font:inherit;font-size:.7rem;cursor:pointer}
.hyr-btn:hover{border-color:var(--accent);color:var(--accent)}
.hyr-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

.hyr-tools{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.6rem}
.hyr-hint{margin:0;color:var(--muted);font-size:.7rem;line-height:1.45}
.hyr-tools .hyr-hint{flex:1;min-width:12rem}
.hyr-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hyr-filter input{width:13rem;max-width:100%;padding:.32rem .5rem;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--fg);font:inherit;font-size:.72rem}
.hyr-filter input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.hyr-empty{margin:1rem 0;color:var(--muted);font-size:.78rem}
.hyr-mono{font-variant-numeric:tabular-nums;color:var(--muted)}

/* strings */
.hyr-strings{margin:0;padding:0;list-style:none}
.hyr-srow label{display:grid;grid-template-columns:auto 5.2rem minmax(0,1fr) 5.6rem;align-items:center;gap:.55rem;padding:.26rem .4rem;border-radius:5px;font-size:.74rem;cursor:pointer}
.hyr-srow label:hover{background:var(--surface2)}
.hyr-srow input{accent-color:var(--accent);margin:0}
.hyr-off{color:var(--muted);font-size:.64rem;font-variant-numeric:tabular-nums}
.hyr-str{color:var(--fg)}
.hyr-str::before,.hyr-str::after{content:'"';color:var(--muted)}
.hyr-sec{color:var(--accent2);font-size:.66rem;text-align:right}
.hyr-srow:has(input:checked) label{background:color-mix(in oklab,var(--accent) 10%,transparent)}
.hyr-srow:has(input:checked) .hyr-str{color:var(--accent)}

/* sections */
.hyr-sechead,.hyr-secrow{display:grid;grid-template-columns:minmax(0,1.8fr) 3.6rem 3.6rem 2.4rem minmax(0,1.2fr) 6.4rem;gap:.5rem;align-items:center}
.hyr-sechead{padding:0 .5rem .35rem;border-bottom:1px solid var(--line);color:var(--muted);font-size:.6rem;letter-spacing:.08em;text-transform:uppercase}
.hyr-secs{margin:0 0 .7rem;padding:0;list-style:none}
.hyr-secrow{padding:.5rem;border-bottom:1px solid color-mix(in oklab,var(--line) 55%,transparent);font-size:.7rem}
.hyr-secname{display:flex;flex-direction:column;min-width:0}
.hyr-secname b{color:var(--accent2);font-weight:600;font-size:.78rem}
.hyr-secname small{color:var(--muted);font-size:.62rem;line-height:1.35}
.hyr-xr{display:flex;flex-direction:column;gap:.25rem;color:var(--muted);font-size:.62rem}
.hyr-bar{display:block;height:.3rem;border-radius:2px;background:var(--surface2);overflow:hidden}
.hyr-bar i{display:block;height:100%;background:var(--muted);transition:width .25s}
.hyr-secrow.is-patch .hyr-bar i{background:var(--hyr-patch)}
.hyr-secrow.is-watch .hyr-bar i{background:var(--hyr-watch)}
.hyr-secrow.is-ok .hyr-bar i{background:var(--hyr-ok)}

.hyr-pill{display:inline-block;justify-self:start;padding:.08rem .45rem;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:.6rem;white-space:nowrap}
.hyr-pill.is-patch{border-color:var(--hyr-patch);color:var(--hyr-patch)}
.hyr-pill.is-watch{border-color:var(--hyr-watch);color:var(--hyr-watch)}
.hyr-pill.is-ok{border-color:var(--hyr-ok);color:var(--hyr-ok)}
.hyr-pill.is-dead{border-style:dashed;border-color:var(--hyr-patch);color:var(--hyr-patch)}

/* imports */
.hyr-imps{display:grid;grid-template-columns:repeat(auto-fill,minmax(12.5rem,1fr));gap:.55rem;margin-top:.6rem}
.hyr-imp{padding:.5rem .6rem;border:1px solid var(--line);border-radius:8px;background:color-mix(in oklab,var(--surface) 40%,var(--code))}
.hyr-imp-dll{margin:0 0 .35rem;color:var(--fg);font-size:.72rem}
.hyr-imp ul{margin:0;padding:0;list-style:none}
.hyr-imp li{display:flex;justify-content:space-between;gap:.5rem;padding:.12rem 0;font-size:.68rem}
.hyr-fn{color:var(--accent2)}
.hyr-imp-st{color:var(--muted);font-size:.6rem}
.hyr-imp.is-patch{border-color:color-mix(in oklab,var(--hyr-patch) 60%,var(--line))}
.hyr-imp.is-patch .hyr-imp-st{color:var(--hyr-patch)}
.hyr-imp.is-patch .hyr-fn{text-decoration:line-through;text-decoration-color:var(--hyr-patch)}
.hyr-imp.is-watch .hyr-imp-st{color:var(--hyr-watch)}
.hyr-imp.is-ok .hyr-imp-st{color:var(--hyr-ok)}

/* indicators */
.hyr-inds{margin:0;padding:0;list-style:none;display:grid;gap:.5rem}
.hyr-ind{padding:.55rem .7rem;border:1px solid var(--line);border-left:3px solid var(--muted);border-radius:6px;background:color-mix(in oklab,var(--surface) 40%,var(--code))}
.hyr-ind.is-patch,.hyr-ind.is-dead{border-left-color:var(--hyr-patch)}
.hyr-ind.is-watch{border-left-color:var(--hyr-watch)}
.hyr-ind-top{display:flex;align-items:center;gap:.5rem;margin:0 0 .25rem}
.hyr-ind-top b{color:var(--accent2);font-size:.76rem}
.hyr-ind-text{margin:0 0 .3rem;color:var(--fg);font-size:.74rem;line-height:1.45}
.hyr-ind-link{color:var(--accent);font-size:.66rem}

/* yara */
.hyr-yara{margin:0;padding:.7rem .8rem;border:1px solid var(--line);border-radius:8px;background:color-mix(in oklab,var(--surface) 30%,var(--code));color:var(--fg);font-size:.72rem;line-height:1.5;white-space:pre;overflow-x:auto}

@media (max-width:760px){
  .hyr-app{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;height:34rem}
  /* Wrap the five tabs instead of hiding the last two behind a swipe. At phone
     widths the natural widths land on 3 + 2 rows. */
  .hyr-tabs{grid-row:1;flex-direction:row;flex-wrap:wrap;gap:.25rem;overflow:visible;border-right:0;border-bottom:1px solid var(--line);scrollbar-width:none}
  .hyr-tab{flex:none;min-height:44px}
  .hyr-tab::before{display:none}
  .hyr-btn,.hyr-filter input{min-height:44px}
  .hyr-panels{grid-row:2}
  .hyr-srow label{grid-template-columns:auto minmax(0,1fr) auto}
  .hyr-off{display:none}
  .hyr-sechead{display:none}
  .hyr-secrow{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n p" "x x"}
  .hyr-secrow .hyr-secname{grid-area:n}
  .hyr-secrow .hyr-pill{grid-area:p}
  .hyr-secrow .hyr-xr{grid-area:x}
  .hyr-secrow .hyr-mono{display:none}
}

/* Tablet touch targets: the layout stays as designed, only the hit areas grow. */
@media(min-width:761px) and (max-width:1024px){
  .hyr-tab,.hyr-btn,.hyr-filter input{min-height:44px}
}
