/* the Help panel (help.js): a wide two-column sheet on desktop, a full-height sheet on a phone.
   Tokens only; both themes come from ms.css. */
dialog.sheet.help{width:min(900px,calc(100vw - 32px));height:min(86vh,760px);max-height:none;overflow:hidden}
dialog.sheet.help[open]{display:grid;grid-template-columns:208px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
.help .sheet-head{grid-column:1 / -1;padding:var(--s3) var(--s4);border-bottom:1px solid var(--line);gap:var(--s3)}
.help .sheet-head h2{font-size:var(--fs-l)}

.help-nav{display:flex;flex-direction:column;gap:2px;padding:var(--s3);overflow:auto;border-right:1px solid var(--line);background:var(--surface)}
.help-nav button{min-height:36px;padding:0 var(--s3);border:0;border-radius:var(--r-m);background:transparent;color:var(--text-2);font-size:var(--fs-s);text-align:left;white-space:nowrap}
.help-nav button:hover{background:var(--surface-2);color:var(--text)}
.help-nav button[aria-current="true"]{background:var(--accent-soft);color:var(--accent);font-weight:600}

.help-body{position:relative;overflow:auto;padding:0 var(--s6) var(--s7);font-size:var(--fs-m);line-height:1.55;color:var(--text-2);overscroll-behavior:contain}
.help-body:focus{outline:none}
.help-body section{max-width:620px;padding-top:var(--s5)}
.help-body section + section{margin-top:var(--s5);border-top:1px solid var(--line)}
.help-body h3{margin:0 0 var(--s3);font-size:var(--fs-xl);line-height:1.25;font-weight:600;color:var(--text);letter-spacing:-.01em}
.help-body h3:focus{outline:none}
.help-body h4{margin:var(--s5) 0 var(--s2);font-size:var(--fs-m);font-weight:600;color:var(--text)}
.help-body p{margin:0 0 var(--s3)}
.help-body strong{color:var(--text);font-weight:600}
.help-body a{color:var(--link)}
.help-body ul{margin:0 0 var(--s3);padding-left:20px}
.help-body li{margin-bottom:6px}
.help-body .linkbtn{color:var(--link)}

/* a term and its meaning: the per-tab lists and the shortcuts */
.help-rows{display:grid;grid-template-columns:minmax(96px,auto) minmax(0,1fr);gap:0 var(--s4);margin:0 0 var(--s3)}
.help-rows dt,.help-rows dd{margin:0;padding:10px 0;border-top:1px solid var(--line)}
.help-rows dt:first-of-type,.help-rows dt:first-of-type + dd{border-top:0}
.help-rows dt{color:var(--text);font-weight:600;white-space:nowrap}
.help-body kbd{display:inline-block;min-width:24px;padding:1px 7px;border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:var(--r-s);background:var(--surface);color:var(--text);font:inherit;font-size:var(--fs-s);font-weight:500;text-align:center}

/* the popularity scale, drawn (not a control) */
.help-scale{display:inline-flex;margin:0 0 var(--s3);padding:2px;border:1px solid var(--line-strong);border-radius:var(--r-pill)}
.help-scale span{min-width:38px;padding:0 10px;line-height:28px;border-radius:var(--r-pill);color:var(--text-2);font-size:var(--fs-s);text-align:center;font-variant-numeric:tabular-nums}
.help-scale span.on{background:var(--accent);color:var(--accent-ink);font-weight:600}

/* boost / bury / block: the only place outside a result where the three colours appear */
.help-bbb{list-style:none;padding:0!important}
.help-bbb li{display:flex;align-items:center;gap:var(--s3)}
.help-mark{flex:none;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:var(--r-s)}
.help-mark svg{width:16px;height:16px}
.help-mark.boost{background:var(--boost-soft);color:var(--boost)}
.help-mark.bury{background:var(--bury-soft);color:var(--bury)}
.help-mark.block{background:var(--block-soft);color:var(--block)}

.help-box{margin:var(--s4) 0;padding:var(--s4);border:1px solid var(--line);border-radius:var(--r-m);background:var(--surface)}
.help-box-title{margin:0 0 var(--s3)!important;color:var(--text);font-weight:600}
.help-box > :last-child{margin-bottom:0}
.help-try{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s2) var(--s4);margin-bottom:var(--s3)}
.help-try-label{font-size:var(--fs-s)}
.help-try .seg{flex-wrap:wrap}
.help-actions{display:flex;flex-wrap:wrap;gap:var(--s2);margin:var(--s3) 0 0}
.help-status{font-size:var(--fs-s)}
.help .btn.danger{border-color:var(--block);color:var(--block)}
.help .btn.danger:hover{background:var(--block-soft)}

/* a phone: the whole screen, sections as a row of pills that scrolls sideways */
@media (max-width:719px){
  dialog.sheet.help{width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:none;margin:0;border-radius:0}
  dialog.sheet.help[open]{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr)}
  .help-nav{flex-direction:row;gap:var(--s2);padding:var(--s2) var(--s4);border-right:0;border-bottom:1px solid var(--line);background:var(--bg);scrollbar-width:none}
  .help-nav::-webkit-scrollbar{display:none}
  .help-nav button{flex:none;min-height:34px;border:1px solid var(--line-strong);border-radius:var(--r-pill)}
  .help-nav button[aria-current="true"]{border-color:var(--accent)}
  .help-body{padding:0 var(--s4) var(--s7)}
  .help-body h3{font-size:var(--fs-l)}
  .help-rows{grid-template-columns:minmax(0,1fr)}
  .help-rows dd{padding-top:0;border-top:0}
  .help-rows dt{padding-bottom:2px}
  .help-rows dt:first-of-type{border-top:0}
  .help-rows dt:not(:first-of-type){border-top:1px solid var(--line)}
}
.help-body code{padding:1px 5px;border-radius:4px;background:var(--surface);font:13px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:nowrap}
